Refactor metric reducers

Try to remove duplicate code for metrics that create single value.
I only make this pull request so you know where this is going.
To be consistent, should we implement Streamable instead of redefining the readFrom and writeTo methods?