Slice based on char_len(), not len()
Simplify parsing DOCTYPE and CDATA opening