Make AMD and CommonJS compatible