MDL-43504 Javascript: Frontpage collapsing should not depend on enableajax

This is an oversight, but we should not depend on the enableajax setting
which we're trying to deprecate.
MDL-43504 Course: Include the course/category collapse JS correctly

This was previously only included when there were hidden categories to show
which were not yet visible. As a result, if all categories were visible,
then the JS was not included.