add support for plugins

This introduces the ability to specify plugins (functions) that can be run before the rendering of each page.

While implemented to be very flexible, I have found it most useful to manipulate my data and to create subsets of the pages array.

If there is interest, I can explain further, as well as provide examples and documentation.