Fixes for grid totals and tests API

Be aware that this pull request will conflict with another one I made today about moving some functionality from Grid_Advanced to Grid_Basic.