Expose test results on test pages

Most of the code is from converting `test-mocha` from a submodule into static code.

The new version of [grunt-saucelabs](https://github.com/axemclion/grunt-saucelabs) uses the [js unit test api](https://saucelabs.com/javascript), so we have to add code on the test pages to expose the results.