Initial work on table sorting.