Express attributes in a sum and not in a list of template args

plus update of the documentation, refactor of the code to further
simplify, introduce easy performance optimisation avoid a second
scan of the AST if not needed.