More Work on Location Sorting

Added some tests and a comparator.