[2.2] ExpandPipe and VarLengthExpandPipe should use relation type token id when possible

This change lets ExpandPipe and VarLengthExpandType  use relationship token ids instead of names whenever all ids in question are resolved.