Major rewrite to add variable-height, grid, grouping support.