Make print statements py3 compatible

Also made some pep8 fixes