Edited PHPDocs and comments
Added setType to form elements for security and to remove the debugging message introduced in Moodle 2.5