front end JS written

Chat.js is critical to execute first, chat_ui.js has a dependency on the
var Chat and the scripting blows up because it hasn't yet been declared.