Added the function num_elements, with tests and documentation
doc e.g. for num_elements, simplified num_elements recursion
Merge pull request #1038 from stan-dev/feature/issue-1026-num_elements

Fixes #1026: added the function num_elements, with tests and documentation