Fix up @heap to work with a key and a compare function.