Add AST-based parser for formulas.
Use default value instead of raising an error when encountering an infinite loop in formulas.
Export used periods into traceback
Add validation of data_type returned by formulas.