core: hierarchical toc/outline, fixes to html reading