Support for changing directory when running knitr

This allows running knitr from the directory that the file is
found in (similar to what source(..., chdir=TRUE) does.  It's
experimental, and the implementation may change to use one of
knitrs options.  Changing directories in a session is very
evil, but I've taken some care to do it in a fairly unevil way.

The location of auto_figure_prefix has moved into the knitr
block.