added command history

The animated gif needs updating but we should wait until things stabilize.
Making it a class would be too slow for this hot code.