Converted the JS to use Node

Converted the JS to use Node instead of CommonJS - Node has won! ;-) There’s a couple of unit tests failing and I don’t know why. However scripted and the tester are working fine.