Fix issue 1026: added the function num_elements, with tests and documentation

#### Summary:

Fix issue #1026: add the function num_elements()

#### Intended Effect:

Return the total number of elements in any type: vectors, matrices, arrays of reals, arrays of arrays, arrays of matrices, etc.

#### How to Verify:

Check the code and unit tests.

#### Side Effects:

None.

#### Documentation:

Included.

#### Reviewer Suggestions:

Anyone.