build tree-like json data object from toc info file