Near completion of CLI

CLI unattended mode (-u) now works. GUI to come.
Misc code clean-up.