Move Collection#sortedIndex definition

Spotted this one recently. I moved the definition closer to `Collecion#sort` and the custom underscore methods (and out of the "private" zone), cleaned up the whitespace of `function (` definition and added a little comment with an explanation of what it does.