Various improvements to the CLI interface and logging.