This adds an optinal maxcells parameter to the rectangle and hexagonal grids, with a default value of 262144 (2^18). An error occurs when the grids would need more cells.