Simplify module loading a little bit. Also add exception checking in the loader.