refactoring into submodules, adding pubsub, updating tets/readme