run_cmd() is now split into get_cmd() and run_cmd()
enhanced docs
logfile is now passed to run_cmd()
code clean up