Communication between server and client done.

Finished a simple communication between the server and the client.
Cleaned up the code, added comments.