Rewrite the the state handling.

Its now:
* Faster
* Requires less memory
* Has compile-time type safety
Add full name to reduce string concatenation
Optimize sending chunks between the browser and workers