Make BaseTerm comparable and implemnt equals and hashCode.