Fix threading model

Clarify the boundaries between threads and remove bad paradigms.