[pyqgis-console] a simple syntax checker for the editor
- some fixes and code cleanup