Implement base stream class
Change streams back to simple middleware classes.
Rewrote middleware, covered with unit tests.
Implement middleware stream
Rewrite middleware processor
Dialogues main class refactoring
Big refactoring