Adds test with compare function to testsorted
Adds comparison function option to sorted

It was a tough decision to make between a comparison function and a
key_function.  I decided on a comparison function since it's so much
more common in c++.  Ideally I could support both, but for now I'm
setting it as comparison function.