Add amd/commonjs

Sorry I don't know how to do coffee script, so I couldn't backport this to coffee. Tested this out and works fine in a requirejs/browserify/webpack/script environment.