Create chat.js

Callbacks for when the user wants to chat the server. Also Polls the server every 1 second for new chats.