Make matches_uri return true for disabled projects
Search for templates only when uri is unknown, not when no job is triggered
Reuse matching_uri output when searching for buildable jobs
Handle separately different template types