Cleanups in the runner

A lot of cleanups:
- Don't use the deprecated os.popen(), use subprocess instead
- Docstrings for method and function documentation
- Use idiomatic Python where possible (if list instead of if len(list) >
  0)
- Use PyQt's own toPyObject() method in QVariant rather than a string
comparison
- Add a FIXME
- Remove stray tabs and mixtures of tabs and spaces