add support for multi-threading

A new command line argument controls how many threads to use. A thread
pool is created and the main work of updating the data structures after
a cluster merge is split equally among all the threads in the pool. The
clustering can be more than 10 times as fast using multiple threads,
depending on how many cores on the CPU.