Untested code for writing new snapshots
Fix bugs and write absent proto fields as null values.
Assign autoincrement IDs back to protos