Improve analyze: add CLI command, add checking framework, fixes