Wrap phantom.exit in setTimeout to make it async.
Modify .jshintrc.

Relax latedef option.