Add ability to filter on relationship fields.

Also add ability to filter on related entities.