heap is now generic, mkinput takes the number of lines as the first arg, rewrote threadpool and thread sort to allow for waiting on the task queue to empty