fix payload read memory allocation bug. more polish/cleanup work. added ability for client to automatically retry failed connections.