Remove .is_finite assumption

fixes #5393
fixes #5385
fixes #7007
Support for single indexes in MatrixExpr

This allows MatrixSymbols to be iterated over, and gives a similar
interface to DenseMatrix. MatExpr are treated as row-major order arrays.
This only works if both the matrix shape and index are Integer/int.