Refactor client and expose only a very minimal set of public methods. Rename various methods and variables. Implement a more robust keepalive mechanism.