Minor fixes to Matrix and MatrixType to make them immutable.
Changed Vector(double[]) constructor to static toVector(double[]) method to make it Vector immutable.