Rewrote parts of the AST and the corresponding Eval translation with the
new modular and parametric way.
Added functions (and patterns) in the new style.