refactor for amd support & return a literal map

heya, thanks for this great repo.

I had to modify it for our needs, and if you feel like adopting the changes we made, here's a pr that:

a) adds amd support, which enables use with amd module loaders such as requirejs
b) simplifies api by returning a map literal as the repo name suggests