Added canUndo and canRedo to support querying whether these commands can
be executed.

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