support for amd and commonjs