Small tweaks.
Moved the the cli interface to a separate file.