Added getNearestValidLocation methods to both Grid and Location
These methods find a valid location by starting at the initial position (or the nearest valid position to that position) and recursively move in the given direction until it finds a pathable position.  If it runs into the far end of the map, it will return null, though this not-found case is incredibly unlikely.
Currently, this method is only used by Entity.putInGrid, which calls it on the input location (unless it is null) to put the entity in at a pathable location