Rewrote image optimisation stuff.

The old one was broken anyway.
Work around and warn if old optimizeimg definition

Before someone says this is incorrect because it only ever uses
pngcrush: The old code always used pngcrush and nothing else
anyway. This is absolutely correct and the old behaviour.

I also added a check to make sure it's a list, as some people might
forget the whole list thing.
Move the check for program availability into class

We also actually execute it now. Go us!
Use check_call(), add workaround for broken pngnq

Also -f pngnq to write files, in case something didn't work
last render.
Merge pull request #1074 from CounterPillow/optimizerewrite

Rewrote image optimisation stuff.