Refactor RankProof: heap only stores priorities
Add reference to sratchpad