Now the PDF figure will be produced and added to the JSON for all values
of figure_format.  This can probably be done better, since the way I've
done it, it is not configurable at all.
Added a PDFFormatter class
Added code to encode application/pdf data as base64, when it is available.