Real-time chat in node.js, terrible implementation