Merge branch 'develop' of https://github.com/stan-dev/stan into develop

Merging upstream develop.
Merge branch 'develop' of https://github.com/stan-dev/stan into develop
Minor fix for log_sum_exp
Adds a test to fwd-diff of log1p_exp
Added sort_indices_* functions
Added sort_indices_* functions to the manual
Added functions sort_indices_* to function_signatures.h
revised doc, section titles, and added examples for sort functions
Merge pull request #563 from stan-dev/feature/minor-improvs-log_sum_exp

Feature/minor improvs log sum exp
refactor of sort_indices_* functions based on Bob Carpenter's https://github.com/stan-dev/stan/pull/564#issuecomment-35143532
Adjustments in rev and fwd diff for the refactoring of sort_indices_* functions
Update distributions.tex

The sampling statement shouldn't have the "_log" suffix, I believe.
Merge pull request #566 from aadler/patch-1

You're absolutely right.  Thanks.  Merging.
Merge branch 'develop' of https://github.com/stan-dev/stan into develop
Changed name of template parameter to avoid compiler bug on Mac OS X 10.7.5.
Changed a bunch of chains methods to be either static or const, as appropriate.
Merge branch 'feature/sort_index' of https://github.com/stan-dev/stan into feature/sort_index
templated container out rather than type of std::vector or Eigen::Matrix
updated formatting to reduce lines to 80 chars and put open curlies on same line as signature
Merge pull request #569 from stan-dev/bugfix/issue-568-epil

Fixes #568.