Ensure uniform printing of nan and inf
Helps to make certain testsuite output identical cross-platform (fewer
spurious failures due to printf differences)
Adjust some test comparison thresholds for better platform-to-platform behavior.
Better testsuite cross-platform robustness by allowing multiple matches.

This is actually porting some guts from the runtest.py from OSL's
testsuite, which had the clever strategy that, if an output doesn't
match its version in the ref directory, will test against every other
file in the ref directory hoping for a match.  This means you can have
multiple references, if for some reason you expect them to differ a bit
per platform and have no other good way to rectify it.
Alternate reference that seems to be necessary on some platforms, probably due to different libjpeg implementation
Merge pull request #515 from lgritz/testsuite

Fixes to make testsuite match better across platforms