Add function GenericMatrix::nnz() to get number of non-zeros in matrix.

Fixes Issue #110
Merge branch 'garth/fix-issue-110-matrix-nnz' into next