Rust upgrade

Most work courtesy of @kmcallister.

I already reviewed Keegan's work, so just the last two commits need attention.