Replaces bespoke testing with mocha tests.