Fix a race condition on metadata extraction at loading

 * When trying to recognizing PDF documents, don't assume that
   PDF.js must be initialized.
 * In PDFTextMapper's waitForInit() method,
   * also wait for documentInfo, not only documentFingerprint
   * fail if it's not a PDF
   * remove useless debug output
   * add more code comments
 * Don't rely on PDFView.initialize() method, because it
   returns before documentInfo is available
 * Remove the redundant waitForLoad() method; standardize on
   _waitForInit()