added command functionality to chat windows and a few minor improvements