Fix severe Undo bug when no selections are active
Framework code for Curves function

Curves is disabled while I work on it, but I had to commit this to sync
the previous commit, which fixed a critical error...