As we always call both methods from the controller - and elsewhere we call the
more general method - and one uses all notes and the other uses system notes,
then we should just load the notes and their authors once, and filter on the
Ruby side.
Whether the preloading belongs in the service or the controller is arguable,
here. As the service is only used for one controller action, it seems reasonable
to put it in the service, but that is not a definitive answer.
Adding the preloads for MR project routes here doesn't seem to work, perhaps
because of https://github.com/rails/rails/issues/32140.
`#referenced_merge_requests` preloaded too many associations. Award emoji, for
instance, are completely unnecessary here.
`#closed_by_merge_requests` had the opposite problem: `#all_references` needs
each item's author, and these weren't preloaded.
These methods don't really need to be on the Issue model. Issue#related_branches
can also be moved to a service, but we can do that in a separate commit.
This commit does not change any behaviour; it just moves code around, renames
the service, and refactors the specs.