start working on python3 support

This is unfinished, it might be hard because of all the unicode weirdness that we're doing.