Questions: Optimize queries for products/topics.

I benchmarked this change on the all questions page locally. According to DDT:

* Before products/topics: 95 queries.
* Unoptimized products/topics: 116 queries.
* Optimized products/topics: 97 queries.

Also, the linter was complaining about a thing, so I fixed that too.

r?