WIP: Only write serialized attributes when changed

- [ ] Squash commits!
- [ ] Get someone to review
- [ ] Consider other methods of doing this...