Update for nightly

I'm a bit shaky on the profile.rs changes (`thread_local!` and `RefCell` relplacing `local_data_key!`), do make sure I haven't royally screwed something up there.
This `ref mut` shouldn't be necessary I don't think.