Implemented writeToSocket and connectToSocket. Need good way to handle
list responses. Perhaps writeToSocket should return lists of strings?