Run existing tests in the browser

The existing tests were not written using Mocha's async support. This PR makes them async and uses expect.js to run them in the browser.

This is surfacing some issues in the browser which I yet don't understand. If someone can take a look at them, it'd be very much appreciated.