Resolves an issue where a module's initialize would be called twice

Also adds more robust unit tests to modules