Replaced the signal-based form gathering with a setting.

Using signals for this was a bad idea from the beginning, a setting is
more explicit, less hacky, guarantees consistent order of forms and makes
it possible to actually customize the behavior.
Added a forgotten JS library for modal dialogs.