More ports of socket comm under MessageDispatcher and QueueGuard. More refactoring.

relates to #97