Added ability to hit test against rectangles instead of pixels.

This is better performance and functions with cross domain images,
unlike the pixel tests.