Add _.comparitor and align sortedIndex to sortBy

Fixes #1768 

This could use some review and thoughts