Refactored for Node.js. Updated README.