Use joins when loading related entities

I switched to using joins to grab related entities when loading related
entities for a collection of objects. This seems to improve the quality
of the generated SQL.