Add class Matrix with tests