Refactored the client and server code. Added the Main class for adding GUI.