Add termination tests.
Control the threads for tests.
Worker state doesn't have to entirely be an atom.
WIP.