Resolve test.js line-ending sensitivity blocking running tests on Windows

Also minor cleanup resolving JSHint warnings in test.js.