Replaced slow and heavy SegmentedArray implementation by two ad-hoc structures for parsing stack and HtmlElements.