Various improvements for dialog/infobox

* Using single shared object (fields) to store private widget state was an
accident waiting to happen.

* New add_fields and remove_all_fields methods.

* Infobox now supports options.initial
Move more dialogs to widgets
Use array instead of object for select_input_field

Order of object attributes cannot be guaranteed.
Change options.fields to array in infobox/dialog

Again to guarantee the order will be correct.
Move more dialogs to widgets.
Fix stupid dialog title.
More stuff moved.
photo_select_field doesn't take type parameter
Fix photo_input_field validation
Photo relationship editing works again.
Don't close dialogs until server OK confirmed.
Remove loads of cruft.
Rearrangements
Fix action select dialog.
Fix various user interaction issues
More updates to user interface
Remove change_mode parameters

change_mode is global, it doesn't make a lot of sense passing it
around everywhere.
Remove no longer used code.
More work on menus.