Refactored for npm.
Merge pull request #1 from silentorb/master

Refactored for npm.