Remove internal modules and move all module code into modules.js