Python 3 compatibility

Onwards to the future!