Refactor CLI related code into new class

Also provide access to start the process with Main.start, which creates
a CLI object and kicks things off.