Added license terms and code documentation for server and cleaned up both client and server.