Make hasOne associations default to LEFT joins.

Using an INNER join makes the hasOne association data required. However,
there are many valid cases where a hasOne association might not have
data. We should stil load the parent record in these cases.

Refs #3902
Add test for associated objects being null

When a hasOne association is missing null should be returned. Giving an
empty entity can be really confusing and makes validation much harder
that it should be.

Refs #3806
Refs #3902
Don't hydrate empty association entities.

When hasOne/belongsTo (joinable associations) are empty we should skip
populating empty entities as they cause problems later on in the
request.

Refs #3806
Refs #3902
Use foreach instead of array_filter.

This allows the loop to be broken on the first non null element.
Add tests for belongsTo and null property values.
Fix typo.
Move tests to the class they belong with.

Put tests for eagerloading associations into ResultSet as the hydration
of entities happens there.
Allow translations of 0.

When a translation is empty, unset the field, as it could be set to
null.
Merge pull request #3917 from markstory/3.0-hasone

3.0 Possible solution to empty association objects