Adds rank() to matrices

Gives the rank of a matrix. I didn't see any documentation for this. If it already exists I'll document it.
Used rref()