Cargoified & updated for the latest Rust.

Now `cargo test` should pass.