perf boosts

- custom pub-sub for propogate state changes instead of event emitter
- minimize closure allocations.
- as we only need to publish once, cleanup subscribers after publish