Add CLI test

Fixes #84.
make test less fragile