support amd, commonjs and browser globals