major re-org; additional backports; isolating qt4 backport from pyqt5 itself (incomplete)