Re-filter children from course materials

* Fixes bug that recent course_materials refactoring introduced, showing child items as both children and as top-level items. This introduces explicit filtering of children in the template to render course_materials, with explanatory comments.  (fixes #2278)