Some clean-up and refectoring following @asafh review. To build, type: 'npm install' and then 'node .' :)