Several tests and the testsuite run import code parse text read from the
data attribute of a Flask response object (werkzeug.wrappers.Response).
However, in Python3 reading from that attribute yields binary data.
The attribute is in fact a property whose getter get_data() as a as_text
parameter that allows to request the result to be a string instead.
This commit adapts all reads from that property to request strings
instead of binary data (the default), except for a few cases in
tests/server/ui/V4Pages.py where the data is fed to ElementTree's
fromstring method in get_xml_tree() which tries to reencode it in ascii
in Python 2 mode if it gets a unicode string.