Adds tighter error checking and better comments to node.js.