Implement command history

Resolves #86