Clean up client, add docstrings, etc.