Move more globals into the state structure.