Convert unit tests to mocha/chai

This unifies the unit tests to use mocha/chai both for the html tests and the
nodejs tests.

The unit tests now all run in node as well as in the browser.

Fixes #26