refactored qunit tests and got them all to pass