heap: use recursive sink and swim

Change heap to use a recursive implementation of sink and swim.
Also make some simplifications to __init__ and delete.
simplify mergesort and quicksort
add "n largest seen" algorithm
add "oldest unique item" algorithm
add "largest span in tree" algorithm
add waterflow algorithms