Introduce AbstractServerSocket, move MockServer into test