Move IsXColliding functions into helpers.

I moved these into helpers rather than the base Sprite class because the
functions have nothing to do with the class. They're generic enough that
they can be used anywhere.