Undo/redo now works, after a painful refactor. Still crashes some though
Preview now clears correctly
Undo/redo now works well for tile painting. Resource addition and
deletion is another matter