Added matrix utils class, changed matrix copy-by-reference to deep copy