Refactored normalization

Mean and MaxDev matrices are now weights, computed inside the code.
StdDev in substituted by MaxDev