Extend heaps to allow removing arbitrary elements via an additional equality operator.

Obviously a comparison function yielding an ordering/c would be better,
but this change is backwards compatible. I needed this change for implementing
the self-adjusting computation algorithm that uses a priority queue that additionally
removes elements that are discovered to be "obsolete."