Use relationship templates instead of putting them in the master template.

Let me know what you think of this.   This is a backwards incompatible change, so I don't know if you want it, but it is necessary for our usage.