Make python3 compatible.

This only needs minor changes to print statements including formatting;
should be backwards compatible with 2.7.