Made metadata extraction async

This is necessary, because sometimes we want to
get the data sooner than it's available,
because of the varying loading time if the
various components. (Including PDF.js.)

 - URL extraction: decode the URI properly
 - Made the `metadata()` method private
 - Added the `getMetaData()` method to wait for
   loading the document, and then extracting the metadata