fixes to make it work on the server or with browserify
Merge pull request #32 from sebpiq/ad035ecb54e9a895833bba87cc34c3787118f52c

fixes to make it work on the server or with browserify