Classical supervisor

Turn the supervisor into a class so we can pass state to it instead of abusing too much global state.

This does create some new global state which is the current supervisor but that is only until a similar refactoring is done to the controller.