Added reply codes.
Added close() method to shut down client.
Added some output to document.