Reworked to use QUnit.