Process thread

Fixes #29