use a boolean variable accessed via the atomic builtins instead of pthread_cancel()

to stop the test threads
generalize the comparators

being used by both the rbtree and the binheap implementations
introducing an AVL tree implementation + made binheap really use the shared comparators