Set root factory in extension

Needed after 85a04435f19f2dfce854db44bae301d66a37a242
Push document metadata from guest to panel

By changing which end initiates the communication of document metadata,
the guest can ensure that it has sent this basic info before continuing
with expensive operations, such as scanning the DOM text. The panel has
a chance to initiate asynchronous operations, such as API requests to
load annotations, before the guest continues.