https://github.com/gjb2048/moodle-theme_essential/blob/master/classes/format_topics_renderer.php -> https://github.com/gjb2048/moodle-theme_essential/blob/master/classes/format_renderer_toolbox.php as an example but you don't have to use traits.
Thanks Gareth, that's helpful! Will take a close look and see if there are more pointers I can borrow. In the meanwhile, I did manage to get something working. Please see my response below.