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.
Merge pull request #7883 from jcrist/matsym_iter

Support for single indexes in MatrixExpr