Initial rewrite of most of the chat handling code to deal with servers