MDL-42299 course: management interface remember categories expanded by AJAX

Categories that have been expanded using AJAX are now remember and
expanded again autoamtically when something triggers a page refresh.