Added support for Moodle 2 and any kind of text replacement