Add support for TAB key in chatbox, fix some problems with messages
Simplifies the concatenation of buffers in packet handler