MDL-44349 core_moodlelib: Improve word counting rules

Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
MDL-44349 core_moodlelib: Add unit tests for count_words()

Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
MDL-45119 ajax: AJAX exceptions need a String in the Link
MDL-45119 ajax: Correct use of COUNT in exception dialogue
MDL-45119 editpdf: Do not load quick comments in read-only mode