"Invert selection" now supported

This commit includes a number of other support functions related to
handling raster selections (e.g. non-transformable ones).  With these,
it should be relatively simple to add the other raster-based selection
functions (grow/shrink/etc).

I would also like to note that the Undo/Redo framework appears to work
flawlessly with raster-based selections.  I think I deserve a pat on the
back for getting that right on the first try, despite no testable
prototype when I first built those functions...

[pats own back]  :)