sortTraitData function

Sort data and remove missing entries for tree and trait data