Added amd support.

For use with requirejs.