File/Directory preference

Modified behaviour that checks out file list for script/style resources. When trailing slash is added to the path, it prefers directories, otherwise files are priority