add PElementMinMax protocol
emin and emax now use protocol implementations
extra tests for emin and emax