Move dq to its own file This is in preparation to having an alternative worker thread implementation, so that dq can be shared among them.
CmakeLists.txt: Cleanup C function detection