added amd loader, commonjs compatibility