Fix bug in node-webkit when requiring "nw.gui"
Update tests to use require()