Added Mocha global variables for TDD style. Fixes #793.

Now with tests, and squashed :-)