FLUID-5110: Refactored to all for refresh

Refactored to allow the table of contents to be refreshed. Still need to remove all of the old anchors so that we don't pollute the DOM when refreshing.