Support for AMD and CommonJS modules

This commit adds support for AMD and CommonJS module loaders