Modified to support browser usage
Merge pull request #6 from Niggler/master

browser support