support optional scope on ITemplateLinkingFunction

The scope parameter on ITemplateLinkingFunction is optional.  This expands the interface to support this case.  I also broke ICloneAttachFunction into its own interface to avoid repeating its definition.