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.