Add AMD support.
Add unit tests.
Merge branch 'master' into gh-pages