Add metadata for state backups.

This is part of my effort to split up the work for backups into a few smaller patches.
Yeah, passing state is a premature whatever--conceivably the next ID could be derived from the collection, thus requiring state to be passed int.  Given that it would be easy to add later, I'm fine with removing it.

As to timestamp, this was mostly for the sake of testing.