Hey no fair!! you didn't say you wanted it to work in both :p
The real way to get the module's working in is to have some kind of plugin template that both stand-alone and DF adhear to. That way the modules are written once (not knocking any of the great work peeps here have done, it's awesome). Perhaps something in the host DB? or in the root folder.. as most of the incompatibility's appear to be directory structure / authentication related.
I dunno really, haven't thought about it before you just brought it up, I'm new to this (php) and just having fun...
Help! help! I'm being repressed