Add basic pub/sub to clean up code.
Remove main extension module from testing.
Only register listeners once.
Merge branch 'refs/heads/refactor/pubsub'