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
Merge pull request #661 from JasonGross/fix-dvi-mode

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