Fix some rightward drift.

(No semantic change.)
Update for mozilla/rust#10796.
Update for mozilla/rust#10701.
Add some missing #[test] attributes.

Ah, this dead code lint is good stuff. :-)
Mark some test-only code as such to avoid dead code warnings.
Update for upstream pkgid changes.
Stop using 'self lifetime (now illegal).