Add metadata for state backups.

This is part of my effort to split up the work for backups into a few smaller patches.
Sounds good to me.  I was going to switch over to generating a UUID, but the mongo one sounds even easier.  How do you do that?