make some things that don't need to be global static instead
Fix runtests to not depend on whether the shell runs pipelines in a subprocess