Ignore src and venv directories in pep8 check
Tidy code and avoid unnecessary intermediate lists
Make `client` at the top level function

This is so that tests can more easily test `query_documents_for`.
Rearrange parameters for consistency
Merge pull request #39 from pwaller/tidy

Code cleanup