Don't load nested references when nesting is disabled
When a reference is loaded, all its nested attachments are loaded as well. This takes a lot of time, while the nested attachments are not used. Loading nested attachments based on the nesting number would greatly speed up the opening of files