Added AMD and CommonJS support.