Thinking on a better utils.py::run_cmd...
With returncode
Improved run functionality
More running of things
Improved command stuff
Another thought
Make the loop for run3 sensible
I think this is both sufficient and necessary
Remove redundant argument
Friendlier ShellError messages
Replace get_cmd_for_output (with run2)

Add the new "runN" functions to utils.py,
and replace all the uses of get_cmd_for_output. Then remove
get_cmd_for_output from utils.py
Cope with ShellError at the top level

(and add some clarification on what we think we're doing)
First swather of replacing run_cmd. Also add shell()

Perform the first swathe of replacements of run_cmd, mostly with
run0. However, if we actually *want* a shell command (e.g., if
we're trying to do "cd xxx; something") then we need the new shell()
function.

Also, port over the env argument to all the new functions (I forgot it
and it is sometimes needed), and make _rationalise_cmd convert any
non-string items to strings - this means if we accidentally convert

  run_cmd("whatever %s"%label)

to

  run0(["whatever", label])

it should still work (instead of getting all confused when it tries
to instantiate the Popen class - which in fact would raise an exception
saying that all the items in the list should be strings:

  TypeError: execv() arg 2 must contain only strings

- correct, but not useful)
Rewrite shell(). Add some more run_cmd conversions
The rest of run_cmd removed
Remove use of get_cmd_data from bazaar.py
Replace get_cmd_data with new, simpler version

(or use runX where appropriate instead)
Fix typo
Rewrite shell(), various other stuff

Hmm - shell was over complex. Simplify it (using the support_for_tests
function as a model).
Control what is exported, and use external "shell"

Since we expect people to do:

  from support_for_tests import *

make that "*" more controlled!