Formulas support scripting

Formulas/math editor allows scripting and IF functions together with support for local variables. Also commenting is possible in editor.