Updated to use AMD. Also mocha test run in browser and CLI.