Added the collate_hw_answers function.

This required some mods to rrhw.R and hence also
to some of the knitr children in rep-res-course,
so I can't really push this up on master till that
is all taken care of.