Added AMD support to the project

The project still works with node and browser globals, but will now also work with AMD.