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
Moved all clientside library javascript into its own folder called lib.
Fixed merging conflicts
Merge branch 'master' into xtremeMakeover