Made a more general d-ary heap. Trimmed down test script