context refactoring
page headers and footers

doc-definition-object can define 'header' and 'footer'
any of those can be a standard document node (of any type) or a function
with two arguments (currentPageNumber, pageCount) returning appropriate node
Fixes #1