added some documentation
Made all messages write to STDERR
added a knitr compiling function