Fix pep8 and flake8 warnings and clean up code in dockutils/run_helper.p...

...y

 - Fixed pep8 warnings
 - Fixed flake8 warnings
 - Minor refactoring