Added infrastructure for undo/redo for drag tool.

Fixed bug concerning undo/redo for changes in tool.

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