change factories for rewrite rules to expect DocumentContext instead of
just Document to enable access to other documents when batch
transforming