Fixes for PyQt5 Qml support

test_pyqt5_qml.py is working now, but on OSX requires a hacked version of qt5 to work around https://bugreports.qt-project.org/browse/QTBUG-33285. I haven't tested on Windows yet because I can't get a PyQ5.1 snapshot to build on that platform.