Correctly handle resurrected documents

Be good to see a further test that makes sure the generation number is incremented when we resurrect.