Refactoring message socket class. Separated incoming traffic into two
handlers. Fix bug noticed in plots controller