Revert root context thread handling

Fixes #565