Made a (messy) attempt to separate chat logic from socket logic.

chat.controller.js
  Added.
socket.io.controller.js
  Added pub/sub system, removed chat-related code and put this in chat.controller