Add initial QUnit tests
Wrap error callback in closure