Tweaks to allow latex (and not only pdflatex) to compile the book

This is required for getting htlatex to work, for an eventual
html/non-MathML-epub target.  The main changes are:
(1) we use \DeclareGraphicsExtension and never pass .png explicitly
now
(2) we patch \includegraphics when not in pdf mode to read bounding
boxes using bmpsize-base, to silence "can't determine size" errors
Minor tweaks to allow cleveref's poorman .sed files to work better

We'll still need to patch them to deal with autoref vs cref, but at
least we won't error or have missing braces.

The poorman option to cleveref was the only way I've found to get
htlatex to compile the book.
WIP htlatex