Backport category-export for Moodle 1.9