This random pick is pretty wrong in fact
Using simpler 2*n, 2*n+1, n/2 for heap

This is a bit tricky but it means less computation during heap update
More readable heap implementation, tests for heap
Fixing two bugs in the heap implementation
Fixing testing infrastructure