First revision of a somewhat working implementation of local undo/redo
support.

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