Don't check against the window to detect node.js, wrap code in a try cat...

Don't check against the window to detect node.js, wrap code in a try catch statement and have it degrade gracefully like the rest of the code.

Fixes #147