Fix group type caching in FolderList, and much refactoring for readability therein.