Refactorings and docstrings in agents.py
Add documentation to uploader, handle socket error.
Merge pull request #4 from atteroTheGreatest/docs_and_refactorings

Docs and refactorings