Add modal configuration, date formatting, structured data and permissions.

Any reason not to have this in the `$form['#attached']` bit?