Change browser/nodeJS detection to work with Node-Webkit

Instead of detecting if `window` exists, check if `module.exports` exists.