add caching, update file permissions, and reduce memory usage in Levels#index