Set tests and fixes and TreeMap fixes

Fixed TreeSet bug #224.
Notice that this involved actually fixing TreeMap, used internally by TreeSet.
Found that the problem was in re-balancing of the tree after removal of an element.