Add finalizePages option to document, and _pages array for unfinalized pages