Changed heap sifting functions to use recursion.

The recursive implementation is simpler and easier to read. GCC will use tail
call optimization to convert it to an iterative implementation, so there is no
performance hit.