Make compatible with AMD for use in the browser.

See: https://github.com/amdjs/amdjs-api/wiki/AMD