More porting to Py3.
Core tests mostly pass on Py 3. \o/

What's left are 3 failures, all ordering issues, where the correct output is present, but ordering is different between Py2 / Py3.