Enhances StreamPair interface for MockSocketConnection
Moves thread work to its own Worker class

The work done in each thread has been moved to a separate Worker class,
isolating it from the Server's infinite run loop.