added functions and unit test
added models that use these functions
updated Stan reference manual
Added the function num_elements, with tests and documentation
added agrad fwd and rev function definitions
doc e.g. for num_elements, simplified num_elements recursion
added unit tests for auto-diff versions
undoing change to make/local that got picked up
promote_scalar and promote_scalar_type functions defined, doc-ed and tested
moved promote_scalar all into math/matrix to deal with order-dependency of definitions
promote_scalar now working with arbitrary include order with static functor-like structs
refactored promote_scalar to allow matrix to be included after scalar/std-vector
bug fix to order of template arguments, additional test for var, plumbing for generator to ensure covariant returns
completed doc for every class and function in promote_scalar and promote_scalar_type
removed stray write to std::cout in generator.hpp
used vector indexing to avoid missing size_t on windows, used unsigned ints for sizes in tests to remove griping
allow vars to have prefixes matching types by checking var names in declarations are not continued
added const to function arguments
Merge branch 'develop' of https://github.com/stan-dev/stan into bugfix/issue-593-op-short-circuit
Merge branch 'develop' into bugfix/issue-593-op-short-circuit