Avoid flagging pages as "modified"

I moved the internals of `writeToStage` in here, in order to be able to use `writeWithoutVersion`.