Added primitive client, and improved interaction between client and server.