Custom gamut conversions: provide both forward and reverse endpoint usage

I'm not entirely clear on what the best behavior is here, but PNGs with
endpoint data in the cHRM chunk need the endpoints to be applied in the
XYZ -> RGB step, *not* the RGB -> XYZ one.  You'd think it wouldn't
matter, but it does.  (Learned that the hard way, lol)

Gamma has also been optimized a bit, for both user-provided and sRGB
default modes.
PNG files: if a valid cHRM chunk is found, use it.

ICC profiles or an sRGB flag get preference, but if neither of those
exist and a cHRM chunk *does*, the cHRM chunk is now used.  This is of
minimal importance for most users, but it was a big help in checking my
color management code, so I went ahead and implemented it.

Test files here for the curious:
http://libpng.org/pub/png/png-colortest.html

PD's output is now identical for all three images, yay!