Moved server connection code into thread so that the GUI updates properly.
Also modified the client to correctly read from the server socket.