Optimise some of the QUnit tests