tests: set files coding to utf8
tests: python3 syntax
python3 syntax
various fixes (coding etc.)
convert dict.values/items to list & replace iteritems with items