Make reference attributes reversible

For attributes where the type is reference, build the reverse attribute so that the entity graph can be traversed in reverse.