Fix returning of ']' chars within CDATA + de-generalized ?-in-PI

I thought I'd handle the ?-in-PI and ]-in-CDATA problems in a more
general solution, but realized that wasn't any simpler or smaller than
these specific solutions.
7 files changed