Added distance/position wrapping for mask helpers

The fact that the width/height of a mask could be one greater than the
maximum vertical/horizontal position on a mask was causing discrepancies
since the helpers were being used for both purposes. Now there's a
boolean parameter to choose which one you need so everybody's happy!
Added surface helpers for tile maps

WOW this took a while. GetTileSurface calls GetSurface on the tile at
the position. GetMapSurface, on the other hand, will find the nearest
surface on the entire map from any position, solid or not, within the
size of the map +/- BoundsOffset. Rather than checking pixel-by-pixel,
GetMapSurface checks tile-by-tile and is bounded, making it much faster
than the previous push-out and push-in routines.