save metadata in pdf

FOr purposes of being able to rebuild a library, it would be a good addition to have the manually added reference data saved also in the pdf atttributes. THis way if we loose the library, it can be rebuilt automatically by reading the metadata in the pdfs.