Add PubSub support

Not sure if using streams is the best way to handle subscriptions as opposed to, say, a callback. But it seems to work well enough. Tested both sync and async versions.