added command history

The animated gif needs updating but we should wait until things stabilize.
If you pull this function out, then the big comment block can become a doc comment and both the `constructor` and `addEventToLog` functions become simpler to read and understand.