Split out toc module, adding tests.