Set 'this' to the global object when running in node.js.

Fixes #589.