cainteoir: store the toc in a cainteoir::document object and use the resulting API to implement ToC functionality