Trac #16265: transducers.weight: new common transducer

In #16141, a class to collect common transducers was introduced. Here,
we enhance this class by a new transducers which is mainly meant to be
used as readily available component in cartesian products and/or
compositions.

We introduce transducers.weight which realizes the Hamming weight (that
is the number of non-zero elements) of the input.

URL: http://trac.sagemath.org/16265
Reported by: skropf
Ticket author(s): Sara Kropf
Reviewer(s): Clemens Heuberger