no need to use srcfile when parsing chunk options
escape_regex() is not used by other functions, so not worth a separate function at the moment

also move stop() to the beginning for less indentation
write \author{} and \maketitle only if \title{} is not empty
factor out the common settings in Rnw, Rhtml and Rmd into stitch()
roxygenize
move stitch() from output.R to template.R
new functions stitch_rhtml() and stitch_rmd()
roxygenize
bump version