Fix the failing tests.

* Focus can only be checked for if the window is currently in focus.
* Up time timeout for mocha and the intern to ensure tests don't timeout.

fixes #489