Sort, index_lookup doc and a few new tests