Merge pull request #1 from michaelenger/master

Allow the script to be used as a node.js module