Added method to Matrix class.
Factoring of Layer and Matrix.