MAJOR changes to the DOMTreeBuilder.

This now supports most of the tree building. It has limited support for
insertion modes, as well as some syntax correction.