New function to test whether a given pair of row,column indices are within
the bounds of the grid.

Also rewrote getFreeAdjacent without using the horrible GET_TILE* macros.
Renamed the function to find_adjacent_space. Note that the new function
behaves quite differently.