Added TOC builder with tests