More work towards the leftist heap.

     - Rank is now calculated and not set.
     - Add a functon check-invariants in order to verify correctness
Typo