This also provides a SetPrepareCmd hook for tests to be able to define stubs for commands that are supposed to be run