Added undo/redo support and safer side effect prediction for view tool.

Fixed a bug in canvas model: if a model is not visible, then null
reference occurs sometimes. Now it works.

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