Allow composition of state modifications and callbacks.

Previous strategy of transforming everything into effects fails because
React's .setState isn't applied in the same scope.