refactored socket.io callbacks into distributedClient.js