Convert to Node.js module and automated test IN PROGRESS