Avoid node.js 0.10.x exit code bug for MS Windows

Fixes #587

see also:
https://github.com/joyent/node/issues/3584
Add rewire method to properly stub dependency

Closes gh-613