Merging basic chat functions with ui

The person who logs in first can send messages successfully.