XMLExportImport: support python3

This includes heuristics to guess the str or bytes from business template
XML: oids are bytes and also some strings that do not decode to UTF-8,
so that we can install python2 business templates on py3.

When exporting business templates, we need to build a list of referenced
persistent objects to export them separately in the XML, this is is done
using noload, in a way which does not support pickle protocol 1 on py3
(the persistent ids are None and the assertion in
https://github.com/zopefoundation/ZODB/blob/d698507bb89eeb38c6e655199bc9f54c909dbf4d/src/ZODB/serialize.py#L669
fails), so we need to use pickle protocol 3 on py3.

With these changes, on py2 we are still using the same protocol 1 and
the output is stable, but on py3 we are using protocol 3 and the output
is different. Business template exported on py

This also adds some test coverage of XMLExportImport, while doing this
it was found that the ad-hoc handling of boolean in protocol 1 was not
implemented correctly and they were serialized as integers (0 for False
and 1 for True), this is also fixed.
19 jobs for zope4py3 in 0 seconds
Status Job ID Name Coverage
  External
passed ERP5.CodingStyleTest-Zope4Py3

01:27:32

failed ERP5.UnitTest-Zope4Py3

01:40:34

failed ERP5.UnitTest-Zope4Py3-jerome

03:52:55

failed ERP5.UnitTest-Zope4Py3-py2-jerome

04:11:14

failed ERP5.UnitTest-Zope4Py3-jerome

03:38:58

failed ERP5.UnitTest-Zope4Py3-jerome

05:09:55

failed ERP5.UnitTest-Zope4Py3-jerome

09:11:06

failed ERP5.UnitTest-Zope4Py3-jerome

06:22:43

failed ERP5.UnitTest-Zope4Py3-jerome

04:49:22

failed ERP5.UnitTest-Zope4Py3-jerome

05:25:11

failed ERP5.UnitTest-Zope4Py3-jerome

05:09:28

failed ERP5.UnitTest-Zope4Py3-jerome

03:18:17

failed ERP5.UnitTest-Zope4Py3-jerome

04:03:59

failed ERP5.UnitTest-Zope4Py3-jerome

05:06:00

failed ERP5.UnitTest-Zope4Py3-jerome

05:21:47

failed ERP5.UnitTest-Zope4Py3-jerome

04:21:45

failed ERP5.UnitTest-Zope4Py3-jerome

04:15:53

failed ERP5.UnitTest-Zope4Py3-jerome

09:06:20

passed ERP5.UnitTest-Zope4Py3-py2-jerome

02:10:02