Add heap sort implementation

I think it would be better to use `(count as int)` and then do the operations. Otherwise the `uint` will underflow when the count is 0 or 1 and the loop will be executed around `2^31` times.