Support arbitrary JOIN conditions.

+ This should also improve _substitute() performance.
+ Forced a syntax change for $relation definitions.