DTK rewrite

Still a work in progress; submitting now for comments to see if I'm going in the right direction.

Rewrite DTK processing so we submit samples from the CPU thread.

Haven't done much testing yet, and there's probably some cleanup left, but
everything appears to be essentially working.
Can you change these to `unsigned int` so they stay consistent with the rest of the file?