Migrate FunctionTemplate to be on demand. (ROOT-6139).