Abstract out PDFJS creation for tests.
We support running our functions outside wrapAsync, so let's make a better exception message.