Refactor determination of whether the field has changed

The types know more about what is going on than the dirty module. Let's
ask them!
Merge pull request #15442 from sgrif/sg-refactor-field-changed

Refactor determination of whether the field has changed