Clear the ModuleStore cache when registering modules

Throw on duplicate calls to ModuleStore.registerModule.
Add test for duplicate calls to ModuleStore.registerModule()