Make Matrix2, Matrix3 and Matrix4 immutable

And other improvements
Signed-off-by: Aleksi Sapon <QcTechs@gmail.com>