QUnit tests refactored, with a few more tests added. Much more to come...