Make sort links do the right thing
Should be sorting in the correct order now
Added tests for sorting divisions