Add pubsub

Added a publish-subscribe module to allow functions in different parts
of the application to communicate in a "loosely-coupled," manner.  The
impetus was to allow the reaper co-routine to take events out of the
index, change their state to "expired", and send them back through the
streams.

This patch updates the datagram handler function to use the pubsub
pattern to send recieved events into the stream-processing functions
instead of processing them itself.

The reaper process then just has to publish events to the same
listener topic.
Make pubsub.subscribe block

We should ensure that when subscribe is called that the listener will
be added to the topic before any further events are published to that topic.
Added a couple of tests for pubsub
Merge pull request #6 from agentultra/event-queue

Add pubsub implementation