Removed all references to Moodle 1.9 vars. Replaced by references to Moodle 2 vars