added new output value 'both' which sends stdout and stderr to both screen and file. it uses subprocess.pipe and threading. Includes corrections from PR #413
keeping temporal order between err and out intact. for output=both write out and err to same logfile