Cache in map when possible

- To avoid possible xdmp:overflow error
- Update unit tests accordingly
Fix list default sort issue

- Passing gridModel.sortname and gridModel.sortorder to client-side
Merge branch 'local'