Per discussion in #10422, we can assume that input cached_context is
always NFD. However input actions->output may not start at a
normalization boundary, so we still need to backtrack to a normalization
boundary in order to get our NFC output. But cached_context never need
change.
This makes no change to the algorithm, but tweaks some of the unit tests
to adhere to this input assumption.
Note: we could consider adding a debug assertion that cached_context is
NFD.
Fixes#9999.
Note TODO items:
- [ ] Renormalize cached_context across action boundary. Blocked by #10369.
- [ ] Add extra tests for surrogate pairs
- [ ] Move set_context_from_string into helper module
- [ ] if we don't apply normalization, we still need to fixup the
app_context, to keep it coherent with cached_context (or at least
we need to verify that app_context is never used in this
situation)