Added support to self-referenced RelatedItem.

Based on @mgaitan work: https://github.com/matiasb/demiurge/pull/5.