Minor performance changes
Created by: rspeicher
Makes Issue and MergeRequest use a counter cache for its notes association. Adds includes
queries to a few places where it would benefit from eager loading.
Also reduces the queries generated by Ability from four on every single project page down to one.