Refactoring of `heapsort`.
Fix heapsort implementation.

Didn't extract values properly in the 2nd pass. Refactor and
optimize.
Move `-O2` back to the cabal file.