Added smoke test for command line invocation and fixed impl which I had borked with
the last round of refactoring.