a simple undo/redo stack using the command pattern