Adds APIs to record a state at some time and use that state to commit
changes to package state. Which allows reconcilation and retry of
competing changes without needing to take the data model lock unless
absolutely necessary.
Also copies over data model/settings changes to make it compile.
Split from actual usage to make review easier.
Bug: 202291547
Test: presubmit, no usages yet
Change-Id: I6738829185022efef4add1805b5a52b3de3d173a