Make the scripting OOP PDF API easier to use (take 2)

This mainly removes the need to call setParentWindow before using the API but
it also delays more messages from being received until the document is loaded
which makes the API easier to use.

BUG=415858

Review URL: https://codereview.chromium.org/870453002

Cr-Commit-Position: refs/heads/master@{#312722}
4 files changed