Python 3 support

I wished 2+3 compat would be cleaner, but parse_qs force me to...