fix heapreplace, heapify

- fix heapreplace()
- fix heapify()
- merge(): take variable number of arguments instead of sequence.
- add references