added equals and toString for terms and TermParser
made disjoint sets immutable

Turned disjoint sets into immutable version in preparation for future
support of backtracking