Add new thread to read data from server in client

You don't have to send a message to recieve new messages anymore!
Additionally do some minor refactoring by moving the code to read
data from the server out