PERF: Combine avatar_lookup and primary_group_lookup into user_lookup (PR #10253)

These two classes were running very similar queries, which could be expensive on large topics

GitHub