Dev fix: State saving was breaking on sort

- My fix a while back for detecting if a column was no longer available
  in a table was duff, since it used $.map which flattens its array
  return, but sorting needs a 2D array.

- Fixed by doing our own itteration