Rework scenarios API.
Improve formulas debugging and convert results of functions to column types.