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