Add semicolon, to appease JSLint.
Factor out test helper functions.
Update mocha.