Fixed entire codebase to work in node-webkit