Python3 support

Does what it says on the tin.