Version for python3

Had to patch some imports and unicode strings.