Use factories to fabricate AMD and CommonJS modules