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.
This needs a more specific name than "helper".  I also think we concluded that anonymous namespaces aren't actually buying us anything.