Remove unused imports.
Add workflow background thread.

Fixes #33; needs proper tests.