Added server-to-client socket unit tests, with util methods

Most of the work here was in setting up the util module to make testing syncing over a socket, and connecting to a socket, easier. The exact mechanics of this will change as our spec does, but the changes to the test suite will be minor compared to if this patch was never done.