[WIP] Refactoring Switching Code

This PR refactors the switching code to loosen the dependencies upon the first-order solver library. It also includes a variant of the switching model that lacks the stability constraints in the usual model. (This variant serves as a negative control to understand why the stability constraints are necessary).

@rmcgibbo, @kyleabeauchamp: I'd appreciate it if one of you could take a quick look at the code. If neither of you has any comments, I'll go ahead and merge this in a couple of days.