Add -sanitize option to log module. (v3)

Reuse the same CString::StripControls_n() function that I defined for #354 (the first commit is the same) to stip color codes (and other control characters) form logs.
Replace #346 and #347. Should fix #191