Generalizing max/min/sum per block

Change-Id: I2211d332a9433e01b1c29da13fafa6dc6d45ab89
Working min

Change-Id: Ie7b972edae19a6241e8de70e1a9b94878a5f34bf