Added some low level tests and accessors.
Added more low-level test cases.
Added more test cases.
Changed to sort function.