A bit of rework on the cli module, and some tests.

I created a private "command" class, which does a better job of
encapsulating the command. I added a few more tests to go with it. The
test from the previous commit is still failing, but this should make the
fix cleaner.
cli: Fixed incorrect handling of empty commands.

These should just be ignored. Some tests to go with it.
cli: run_command exits cleanly on wrong arg count.

test suite now passing.