refactor(kernel/type_checker): break infer_type_core into smaller methods

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
perf(kernel/type_checker): improve infer_lambda performance

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
perf(kernel/type_checker): improve infer_pi performance

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
fix(frontends/lean): calc configuration commands, add check_constant_next auxiliary method

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>