Decoupling ChatInterface

Complete decoupling of the ChatInterface and some refactorings