Add support for AMD (asynchronous module definition)

This change adds support for AMD, as used by module loaders such as require.js (with fallback in case a module loader is not present).

I see in #38 that you are considering removing the coffeescript file, so I didn't bother modifying that file as well.

Let me know if anything else is required.

Thanks
JC