client-side chat.js and process commands