Graph view field selection improvements

Task 8747: allow the user to select every field from the model to be grouped by, in the graph view.  This PR does exactly that, and groups the date selections in submenus.

This task had the unfortunate side effect of exposing many bugs in the way date/datetimes are coded in reporting views.  So, to prevent a large number of traceback/crash, this PR also fixes these problems, including:

* remove old 'day', 'month', 'field' and replace them by the actual
date/datetime field
* remove weird cast to char when creating the view to prevent crash
when grouping on them
* don't cast a date to a char, then to a date,
* remove duplicates (such as 'creation_date' and 'create_date')
* fix typing errors (field type date defined as a datetime in the
postgres view)
* fix search view definition
filter+map?