Threaded Client

Threaded the client code. Now sending and receiving are asynchronous.

Added a small bit of error handling when connecting to the server.