Rework of pub/sub.

Still need to clean up specs.

@mattdrees Feel free to start reviewing it while I work on the specs.