Move test to correct place.
Add methods for doing error handling on detached threads.

Closes #11.