[Refactoring] Move Type::reliesOnTident into a visitor class
[Refactoring] Simplify the role of inferType function

Move lambda deduction handling code from inferType to deduceType
[Refactoring] inferType