support for AMD and commonjs