Added tests from PDF examples.
Added simple test for sorting helper function.
Basic sorting function.