Support for AMD and CommonJS.
Merge pull request #45 from twentyrogersc/master

Add support for AMD and CommonJS.  Thank you twentyrogersc!