Undo/Redo work

Clean up, multilevel support
TODO: Floodfill support, UI indication when redo/undo are unavailable