clean & refactor (node-only)
Merge pull request #1 from ramitos/master

make module not depend on browser code, which allowed a refactor and cleanup