Created a class to handle client messages.
Fixed the visibility of some methods for unit tests.