Added LibGD.

Now also tests (shrinking) using LibGD, making this project badly named.  The
testcase uses the Perl interface to GD.

Also added miscellaneous minor tweaks and fixes.