Simplify main; extract to Controller.exec_cmdloop

Also reduce # of flake8 warnings from 54 to 49.
The explicit `is None` is a style thing throughout our entire codebase, probably better to leave it alone.