Various Moodle 2.5 fixes

Add various fixes for Moodle 2.5 including adding missing setType calls in the mod_form