Refactor MainCLI to run as a real class, not a static program.