Populate history command

Replaces #60

Both the command itself and tests need work. I did not address timestamps yet.

Once coverage is good the queries need optimization.
Is it possible to check the return code of a command (0 or non-zero)?