Implement chat handling in server
Merge branch 'chat'