Ensure PersistentStates::Object tracks changes.

Make the generated setter method actually set the changed value.
Ensure the changes output lists the changed attribute, with both
before and after values. e.g.

    state.changes #=> { 'attribute_name' => ['old_value', 'new_value'] ... }