A simple implementation of heaps.