Cleanup module code generation, fix importer dependency issue