Add app version to JS and CSS

This leads to the regeneration of the hash in case a single application is updated. - This does not touch the Assetic Pipeline because I don't know how it works.

Fixes https://github.com/owncloud/core/issues/11374

@karlitschek Shall we backport this?
I hope this loop doesn't have any performance impact.
Since the $versionHash is stored statically it will compute it only once per request, but will likely recompute it for every requested resource.
Would it make sense to store it in the session ?