Fixed a bunch of jshint errors and changed tests to use nodeunit instead of mocha