A lot of fix preparing parent-child usertemplate

Two changes to the db structure:
1) survey_item->survey_item is no longer needed because it is always equal to parentcontent
2) surveyfield_fileupload->filetypes was giving me an error I did not understand. Changing its name the problem left. I replaced it with: allowedtypes

- The new method 'userform_get_root_elements_name' has been added to each item. It returns an array with the names of the mform element added using $mform->addElement or $mform->addGroup
- The method 'parent_encode_content_to_value' is no longer used. It has been deleted
- The method 'userform_mform_element_is_group' is no longer used. It has been deleted
- In manage items page, when asking for SURVEY_CHANGEORDERASK the order of the items MUST be forced to 'sortindex ASC' because of the way the routine, to display the movehere placeholder, works
- Each css class 'iconsmall' has been renamed to 'smallicon'
- icon has now the correct position and sixe in table#manageitems, table#manageitems and table#validaterelations
- SURVEY_EDITITEM, SURVEY_CHANGEORDERASK, SURVEY_RESPONSETOPDF are no longer actions because they do not modify the database. I classified them as: view
- SURVEYFIELD_TIME_DAYOFFSET and SURVEYFIELD_TIME_MONTHOFFSET are now constants as SURVEYFIELD_TIME_YEAROFFSET already was
- three lines of code in autofill->userform_mform_element are now commented as they appear to be useless
- fieldsetend->userform_mform_element has been drastically simplified
- fixed tiny bug in integer->userform_get_filling_instructions when (!$haslowerbound && !$hasupperbound)
- added $this->formrequires['parentid'] = false; to autofill/plugin.class.php because autofill can not be a child (I can not imagine any real case needing this)
- added $this->formrequires['parentid'] = false; to pagebreak/plugin.class.php because pagebreak can not be a child (to be honest: I do not remember why)
- added public $MDL41767wasfixed = false; to rate/plugin.class.php to follow the status of MDL-41767
- added class to rate items using radiobutton to get indented
- maxlength is not mandatory in textarea plugin so minOccurs="0" is needed in textarea plugin shema
- note and variable name have now a long text field in itembase form
- added the mssing 'applyusertemplates' to survey cover page
- added htmlspecialchars to templatebase.class.php/write_template_content to save a usertemplate with '&' within fields
- when in preview mode, children in a page greater than the parent page can not be filtered on the basis of the parent answer simply because it was not saved (preview mode)
- added sesskey to $OUTPUT->action_icon url asking for an action
- added an Exception in view.php when trying to diplay the first page of a survey found without elements!!! Really impossible.
- changed next_not_empty_page to ALWAYS allow items in pages with child items whether in preview mode
- added $view to mod_survey_submissionmanager class
- added $view to mod_survey_itemlist class
- added restrictions to links in the survey cover page to allow/deny the access to the a new survey form
Merge branch 'master' of https://github.com/kordan/moodle-mod_survey

Conflicts:
	classes/itembase.class.php
	classes/view_userform.class.php

last two php pages after fixinf few conflicts