Use heap instead of list while merging files.

Good speed up. Complexity of merge is now O(n*log(m)),
n - total number of lines, m - number of files