Merge forked mcmc_writer branch into stan-dev

Just updating a local development branch.  A pull request into master will soon follow.