Pub/Sub implementation

There are more things to do, but covers most #7