Turned all client-side socket.io operations into a class for easy use and portability.