d2vsource: Fix mixed code and variable declarations

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Allow user settable threads.

Fixes #10.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>