Fix the TOC next/prev navigation

Fix the TOC linking code. Added links to the next top level section. Added specs.