The 'registry' global in Module.cpp appears to be destroyed before the last
module is destroyed, specifically the math module. This is bad, because ~Module
tries to look for itself in 'registry' after it's gone. This causes a nasty
debug assert in VS2012, and a shutdown crash in release builds.
Fixed by dynamically allocating/releasing the registry.
The module registry throws an exception when trying to register a module
instances if an instance is already registered under the same name. This
backfired in love.thread when requiring love-modules.
Module::registerInstance() registers a module instance which can later
be retrieved using Module::getInstance().
registerInstance() is called in luax_register_module().
getInstance() expects the full name (as returned by Module::getName())
of the requested module.