Convetion change for output variables and sagfe-guarded the function Grid::GetIndexRange if the AABB is out of range
Cleaned up Grid with comments and other minor code structure changes