Add ability to generate context on a per-page basis

This adds support for specifying the data option as a function that gets called for each file with the file as a parameter, allowing different contexts for each file processed.