Further improve addScript logic, migrate to uksort()
Further improve addScript logic, migrate to uksort()

Instead of the logic with `first` and `last`, store dependencies in an
own array and sort the scripts topologically by its dependencies later.

Signed-off-by: Jonas Meurer <35a2c6fae61f8077aab61faa4019722abf05093c@freesources.org>

nextcloud/server,nextcloud/server,nextcloud/server,nextcloud/server