simplify a lot code generation for DSL

the functions of views and designs (map, reduce, validate_doc_update,
filter, list, update) are now expressed with `function` which is an
expression and not a definition so that no extra function is created
around, and they can be used as literals