Major CLI refactor (close #1)