First round of main.js cleanup
More cleanup, and adding new jasmine interface methods
Fixes for test runner on desktop