Fully implement metadata caching

This solves the last outstanding metadata bug in v6.0 (that I am aware
of, anyway).

Here's the deal: metadata can take a long time to parse, especially on
an old system.  To ameliorate that, I introduced a new preference that
only loads metadata when absolutely necessary (e.g. when saving a file,
which takes a long time anyway).  This way, users who don't care about
browsing metadata can load images much more quickly.

The problem comes when loading a JPEG, making changes, then overwriting
that JPEG.  Because the original file (with all its metadata) is
overwritten, we can't simply use ExifTool to copy metadata from source
file to destination file, as the source file no longer exists!

To get around this, PD now caches metadata in either binary or XML
format (per the user's preference) prior to overwriting a file.  Once
the new file is written, the cached metadata is then appended to file.

This commit also fixes some other miscellaneous metadata issues, like
removing padding tags when "preserve only relevant metadata" is enabled.