tests/harness.py: factor out the command running logic into a Command class
tests/harness.py: rework the command handling to make use of the new Command class