Optimize the name change fix

It will no longer emit contactNameChanged() for every contact, just the
ones which should be changed.