I think it should be considered OK for OptimizerStates to mess with the state. It does introduce ordering issues but these will be complicated any time we have objects messing with the state, whatever we call them. And they are executed at the right time.Any comments? I don't think using OptimizerStates for this is appropriate, since they generally are optimizer-agnostic, and probably shouldn't be tinkering with the optimization state, whereas a DynamicsAction would be expected to actually go in and mess with the velocities etc.
Also if we want to outlaw it, we should change various pointers to const.