Fixes #283.

Adds support for knitr templates.