Forward-port to Python3

First pass at doing this. It looks like the tools discourages the use of tuple arguments or something but it’s unclear why.

cc @benkiel