Port to rust 0.6

Fixing deprecated syntax, adding necessary unsafe blocks, fixing rename breakages