associate cache dir with the output format as well

I think the cache dir should be associated with a specific output format just like the figure dir, otherwise the cache can be frequently invalidated when switching between different output formats because each output format has its own set of chunk options.

I put `output_format$pandoc$to` in `pandoc_to` since there are multiple instances of it. If you do not like it, I can remove it and make this PR a one-liner change.