Sort files for stable loading