Added functions to maputil for getting indices of rectangles, lines on grid

Also fixed index retrieval based on float (x,y) points