rebase: check no-op before checking phase (issue3891)
This could lead to user confusion, because phases aren't really involved at
all when attempting to perform a no-op rebase.
template: call runtemplate on the src argument to sub
This allows using a template keyword on calls to the sub function and brings
the function inline with most other semantics of the other template functions.
run-tests: introduce --random for running tests in random error
This is convenient when investigating failures one by one to avoid running the
same fixed tests first every time.