Pull only the latest tips.

The idea here is that we decorate the relationships in similarly named
properties to build the additional filtering on top of the
relationships.

These properties decorate the relationships with appropriate calls to
distinct and order_by and return the resulting Query object so that we
can do further filtering on top of it if need be.

Relates to #492

Signed-off-by: Joonas Bergius <joonas.bergius@gmail.com>
Trap bug from issue #492

Signed-off-by: Joonas Bergius <joonas.bergius@gmail.com>
Merge pull request #495 from joonas/fix-tip-references-to-pull-latest

Fixes issue #492