Sort terms

Sorting of terms by implementing java Comparable interface on Terms and using the Collections sort function.