Re-implement CLI using Thor.
Merge branch 'cli'