Makes the necessary changes, including adding helper funcs, to bring the CLI up to an integration-testable state. The changes made in this commit should be sufficient for most other CLI tests. Includes a single test as verification.