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 don't see any changes to cloudcfg.go.  Why is this test changing?