Move tests.end2end.cli.common to tests.end2end.cli

Includes several fixes to use this functionality at its new location.