Add metadata for state backups.

This is part of my effort to split up the work for backups into a few smaller patches.
Is something going to use this result in another PR? Nothing does in this one, so I'd prefer if we just did the c.Checks and left out the "&& res" business until it's actually required.