correctly differentiating between node.js, node-webkit and the browser

correctly differentiating between node.js, node-webkit and the browser, see #23