Support criteria based lookup for statuses

Only cache results for ALL items
Support packing system messages into the session

Messages are extracted on post-action redirect.
Support adding comments on status change

If a comment is provided it's handled as an internal note - allowing for
alerts to be sent out (if enabled)
Ticket status change

Move ticket status change to unified backend.
Bug: Fix navigation

Fix cases where first item added via addSubMenu got deleted.
Add modal dialog for alerts
Add getChoice to ChoiceField

This allows for subclasses to define how the choice is formatted.
Split ticket status states into public and private
Remove internal ticket states from user space

Reserve 'archived' state for automation
Support custom statuses deletion

Statuses with tickets cannot be deleted
Fix orm to class gracefully when joins are not inspected
Add create date to new statuses
Support ticket deletion

Delete tickets for realz when set to 'deleted' status. This commit will be
partially reverted once data retention plugin is added.
Support loading spinner on generic popup dialog

Empty the popup container and show loading spinner
on-load hide the spinner and show the content
Use generic dialog popup on items config

Unify use of modal dialog
Make popup dialog graggable
Drop ticket flags data

Flags will be reimplemented as a separate feature.
Revisit ticket status

Cleanup status change form
Add resolve to ticket ticket view
Use the new status table when checking for overdue
Drop status column in favour of status_id
Initialize search backend on install/upgrade.

Make table prefix consistent
Support setting status on ticket open by staff

Staff can now select desired ticket status on create
Only allow staff with closing permission to set tickets to resolved state.
Add translatable verb to ticket states
Remove table caption header
Merge pull request #1159 from protich/feature/custom-statuses

Custom Ticket Statuses