pep8 code readability changes

making the code easier to deal with

Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>
python 3 fixes

future proofing

Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>