Bug fixes to Heap

Under certain code paths, the binary heap would become corrupt.
A number of macros have been introduced that can be toggled, which
check the integrity of the heap before and after each (public) call.