Fixes for compatibility with Rust master

* "extern mod" is now "extern crate"
* std::ptr::to_unsafe_ptr has been removed