Convert all selection functions to use new bounding rect values

Warning: huge commit

Previously, all selection functions assumed a selection shape that fell
within the selection's width and height.  With the forthcoming addition
of inverted selections, this assumption is longer valid.

All selection functions now use new bounding rect values to determine
their operating area.  This will make it trivial to handle extremely
complex selections (e.g. magic wand) in the future.