[Refactoring] Improve overload iteration and IFTI processing

Points:
- Improve overloadApply for overloaded templates
- Merge functionResolve and templateResolve, and do IFTI process in one iteration.
- Remove helper type `TemplateOverloadSet`.