refactor chat.js; add send button functionality