Add support for AMD and CommonJS.