[utils] Speed up sorting code used by library views

Sort a table of references to maps, rather than shuffling the maps themselves.
Should speed up time taken to enter library views like movies.