Refactor to add MessageQueue to sockets and add chat