cherry pick from pull request: Added support for RequireJS AMD.