a little runSubprocess clean up
preliminary modularizing
Added more TODOs