Python 3: Byte streams decoded with default locale

This sorts out the issue with Python 3 where streams are understood as bytes, not strings. Decoding is needed to convert to strings.

As usual my vi auto-cleaned whitespaces (sorry for that). I also removed one unneeded import.

Some tests are failing, but I think that is due to other commits done elsewhere