Major refactorization re:inheritance
Adding TeX document support