Heapsort implementation designed to deal with arbitrary fixed-length records