CompileFunction and LinkFunction in DirectiveDefinition

Changed Compile and Link into CompileFunction() and LinkFunction<T>() to
allow different parameter declaration with Link and Compile delegates.
Updated examples.