This allows the implementation to vary in the number of arguments provided
to the expectation handlers without breaking BC so long as the meanings of
the shifted arguments do not change.
My original prototype was more feature-rich than this, but this formalizes
it and provides self-tests.
It is indeed odd seeing shell code that does not look like shell.