Refactor cli

Splitting up the interpretation from the execution logic.