Pass callable instead of task to threads.

Fixes #46