Fix print syntax for Python3.

Why are we even using print in a library???

Change-Id: Ic2bc22b5a90e240b4ff1ba6dd9a7f52746bd2079
Fix PEP8 issues and tests.

Change-Id: I0d5b6de65269a927e44df371d040322d996c51e4