Add AMD (asynchronous module definition) support

Add support for [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD).

Boilerplate code taken from [UMD patterns repo](https://github.com/umdjs/umd)