Added AMD support.

Boilerplate code copied from: https://github.com/umdjs/umd/blob/master/amdWeb.js

I am using this library inside an [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) based [project](https://github.com/deciob/nightcharts), so I thought it would be nice to add support for it. 

:)