Final revisions

This should be ready to merge afaic, at which point I'll start the resubmission process.