Prepared the code for the new EchoManager class.
General code clean-up and refactoring.