Major refactoring (0.2.0)

This PR will lead up to 0.2.0 release.

TODO:
- [ ] Fix all TODO:s in code
- [ ] Fix pubsub
- [ ] Fix pipelines