Add venv stuff to gitignore
Refactor client socket code

Support different message protocols with the
same socket connection boilerplate functionality.
Also, fixes long time issue with End of Stream errors.