Big refactoring done in other order: First, here, gDoc is made persistent. Later we will come back to the mask ownership.