Improve various parts of Dashboard::ProjectsController

What does this MR do?

This MR adds various performance improvements for the controller Dashboard::ProjectsController, reducing the time spent in queries and the number of queries being executed. For example, in my development environment the projects dashboard page went from 30-something queries down to just 12 queries.

See for more information.

Does this MR meet the acceptance criteria?

Edited by yorickpeterse-staging