Creates a table of contents that can be inserted into the DOM