First pass at ModuleLoader portability.

Doesn't do all the things, and some amount of this is going to have
to be VM specific anyway. But this at least starts to clean up some of
what can be stored.