Merge down updates from upstream

This was a relatively non-trivial merge, so please scrutinize carefully.

Let's try to start doing these more often (i.e. maybe right after each downstream-fork change?) so that such significant merges can be a bit more iterative.