Added get_app_paths() to the AppCache.

This method is useful to discover files inside apps.
Fixed #20485 -- Refactored loaddata for speed.

Thanks Anssi for reporting this performance bottleneck.