added amd && commonjs support