MDL-45560 report_log: Close sessions before download only

If the session is closed too early, then preferences made in the body of
the page will not be saved to the session.
MDL-45714 backup: Less aggressive removal of old backup dirs

The old 4 hour standard was too aggressive and can cause backup files
to be removed while they were still in use. Now the same as cron,
1 week.
MDL-45634 editor_atto: Adding type button to toolbar buttons

This prevents the browser to assume that those buttons are submit
buttons. In which case the submit action was stolen and the form
could not be submitted pressing the 'enter' key.
MDL-44501 mod_data: Only attempt to export files when a file exists.

The error only occurs when portfolios are enabled and there is only one field which is
a file field.
MDL-39726 backup: Move question files by context, not one at a time

Use question category contexts to send file to the file pool in bulk.
Questions are only restored in whole category chunks, so this is safe
to do.
MDL-45574 Backup progress: Can time out with large number of files

When there are many files inside a single resource, it's possible
for the backup to time out because it does not report progress
while adding entries to the backup_ids table.
Merge branch 'MDL-45714-master' of https://github.com/merrill-oakland/moodle
Merge branch 'MDL-39726-master' of https://github.com/merrill-oakland/moodle
MDL-45769 Behat: Fixed behat, was failing because of xpath chaining
MDL-45769 behat: use final versions of symfony and behat
Merge branch 'MDL-45634-master' of git://github.com/FMCorz/moodle
Merge branch 'MDL-45560-master' of git://github.com/andrewnicols/moodle
Merge branch 'wip-mdl-45769' of https://github.com/rajeshtaneja/moodle
Merge branch 'wip-MDL-44501-master' of git://github.com/abgreeve/moodle
Merge branch 'MDL-45574-master' of https://github.com/sammarshallou/moodle
MDL-45729 assign: conditional submission summary

Only show the submission summary if user has assign:submit capability.

Amended to fix some whitespace and the commit message.