npm-ified the package so it can be used in the browser or in nodejs.