PubSub integration

The pub/sub didn't work at all before this. I tweaked it a bit, the unsubscribe doesn't seem to work (not so sure?), maybe we'll figure something out soon. However with this the pub/sub overall works fine now, you can see that by running the tests.