Add unit-tests to verify that all DAO methods correctly create change records. Rework the change detection to use the new operation hooks, this fixes the bugs where operations like "updateOrCreate" did not update change records.