Added interface HistoryHandler to decouple handling of executed command
versus their references.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>