Add -lpthread
Add spilling sorted chunks on disk
Add --outfile option
Add function to generate temp file name