Add tests and documentation for state machine changes.