Refactor controller manager.

I also added a controller manager test, and fixed a locking problem and a potential race. Integration & e2e tests still pass.
I thought that this indicated a channel close too?  But I guess if it did then 'ok' should be false?