add virtualenv and pip requirements file
use all() instead of nested ifs
pep8 fixes
reduce code duplication, simplify