Refactor the tests to reference QUnit explicitly

Added wrapping function. Fixed syntax errors (thanks to JSHint). Added a
test for the existence of the required globals.
Remove the unused logEnabled variable

Its single usage was useless.