Lazy loading of fileinfo

Only make the calls to the filecache when the data is actually needed.

This allows us to, in the future, pass the fileinfo in filesystem hooks without hitting a performance penalty if it isn't used.

Short term, the main advantage this gives is not having to load the permissions data every time.

cc @DeepDiver1975 @PVince81 @karlitschek