refactor much of the cli

- all output logs are now events so they can be toggled
- folder renamed from commands to cli
- almost all logic removed from the binary
- add usage information to roots tpl command
mock out cli test cases
add a bunch of cli tests
switch optimist for minimist
correct chdir call
Merge pull request #429 from jenius/v3#cli-refactor

Refactor much of the cli