Split processing input and generating output into separate steps

This is so that by the time templates are run they have a complete
list of all pages.
Comment