feat(exports): added web worker compatibility

The lib can now be used in a web worker.

fixes issue #65

And btw I fixed a small bug in the tests.