Move R code to separate files

This commit moves the embedded R code outside the document
and then uses the fancyvrb package to display it inline. The
book no longer uses knitr and this is hopefully a more
approachable setup.