Some more tests

This PR could really use some more eyes, especially for the watch mode test. I'm kind of anxious of all the child_process hackery/tricks as I'm not that proficient in Node.js.

See also #1795.
Should probably remove any logging before you merge.  Funny thing is: I noticed it in the Travis CI output before I spotted it here!