Update toc javascript to hopefully be more performant