Changed to use daemon threads

Fixes #4