Trim whitespace
Fixes for python 3 exception syntax
[0.15] Source-compatibility with Python 3.3+

The changes are roughly as follows:

* Remove print statements
* Change iteritems() to items
* Work around the numeric/string type differences
* Use the metaclass class decorator from six
* Work around the iterator interface changes
* Replacing functions which were removed (like izip)