The TeX environment nowadays has hundreds of specialized packages which provide micro-typography support, programmatic diagrams, advanced mathematical features, detailed cross-referencing, multilanguage support, advanced treatment of fonts including ligatures, linebreaking, justification, character protrusion, grayscale balancing... A cursory glance at the PDFTeX author's thesis work may give an idea of how far the system has evolved:
http://www.pragma-ade.com/pdftex/thesis.pdf
It is impossible for me to adequately convey the TeX ecosystem in a comment -- you may consider that my question is aimed at people already familiar with it.
Now, I understand that current web technology seems to be improving to the point where, as you say, "you have an underlying engine that arranges text with arbitrary modifications..." So, I am left with the question of whether the TeX ecosystem can somehow be ported completely to create, say, HTML5 documents or something like this, instead of the current PDF output. I am talking about something new - this will not be a PDF, and it will not be a traditional webpage with features such as re-flow or "multi-browser support"... this would be an electronic publication where the author has complete control over the viewing experience. The advantage of this would be the possibility of extending TeX even further, to allow for programmatic control of the reading experience, to include features such as folding, nonlinear document structure, embedded media and code, and many other things I can't even fathom. If the current toolchain does in fact have the capabilities for TeX to be implemented in it - then it would be very interesting to create a plan for how to accomplish this goal in the proper way.