fixed bug that prevented requiring this as a node module

I was unable to require this module using browserify so I fixed that in this PR