update the docs for sort/sort! and add some related tests