Apply different, stricter, code cleanup when we receive HTML (WYSIWYG)
paste events, but be more lax the rest of the time.
Also, update the regexes to be more targeted for specific code patterns
pasted from office packages.
Old code failed to clean the editor div which resulted in
undesirable code being being left in the div for editing. To properly
handel incoming code, we should try to intercept and clean before the
paste, or clean the entire editable div.
Both $CFG->logsql and $CFG->dblogerror had no use in moodle core
since ages ago (just the former had one use for nothing). Good time
to get rid of both as they are 100% misleading.