tests, cli, and config refactoring