StateHistoryQuery: Make whereToSql robust

This fixes bugs is a array for expression comes in or types
does not exist.

fixes #7133
Catch exceptions in MenuItemRenderers

fixes #7157
helpers/attributes: escape value

refs #7177
viewHelpers: There is no $this, not before 5.4

refs #7177
viewHelpers: use the view

refs #7177
Add stub for javascript behaviors
Apply behaviors correctly on startup
Move javascript behaviors into separate classes
Remove unused behavior base-class
Move navigation events into behavior
Do not follow empty menu links
Merge stash
Only apply navigation link-click handlers to menu
Merge branch 'bugfix/move-events-into-separate-classes-7140'

fixes #7140
Add missing event unbind
Add missing use-statement for Exceptions in MenuRenderer

fixes #7157
Use eventlistener to bind and unbind behavior events
Execute apply-functions of behaviors on the rendered event