More work toward python3.

Mostly use of compat / six and fixes with implicit str/unicode conversions.