modify src to support amd commonjs standard