fix(exports): added web worker compatibility

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