Major refactoring of concurrency to eliminate race conditions (I hope!)

Signed-off-by: Rick Copeland <rick@synapp.io>