Use Task instead of raw thread.
Merge pull request #1 from naotaco/fix_threading

Use Task instead of raw thread.