Better automated tests

Use Mocha and Chai for running automated tests instead of Jasmine.
Seems to be missing onFailure handlers. To report an error asynchronously in mocha, you can do:

    onFailure: -> done new Error