improvements to diagrams-latex.sty

  * add options to specify backend and output extension
  * don't require a trailing / after the output directory
  * create output directory if it doesn't exist