Move toc code into its own class
Improve Toc class