As part of the toc patch chain in core and Parsoid, we have been creating first class objects for section metadata and TOC data.
There are a number of patches in gerrit that have migrate over parser output and output page and TOC generation code to use these classes. However, those patches also add b/c code to ensure legacy uses of associative arrays continue to work.
This is a placeholder tech debt task to migrate over other uses in core and extensions to these new interfaces. This work will have to wait for all the patches to be reviewed, merged, and deployed.