dwaLookups.cpp: multithread the time consuming parts

The initial building of dwaLookups.h can take few minutes to run. Most of the time is spent in a brute force search, which is fairly straightforward to subdivide. 

Refactor dwaLookups.cpp to use ```IlmThread::Thread``` when possible, and add some build system tests to guide us as to how to detect the number of threads to use.

It looks like dwaLookups.cpp didn't get reformatted to match the rest of the project. I tried to keep to the existing formatting for now. It seemed like reformatting would cause a bunch of extra noise in this PR.