Implement tidy function for node.js control script.

Addresses bug 927761 for Node.js.