Fix chat issues, improve chat rendering
- We now selectively append to either after pending msgs, or to
the top of the chat, depending on whether there are msgs
pending or not
- jshint fixes
- remove debug logging