Port to latest pyqode.core dev branch