Fix for current nightly

[The `~` syntax is going away](https://github.com/mozilla/rust/pull/13958), and most of it was already removed (with the exception of `~str` and `~[]`). This PR changes the current uses of `~T` to `Box<T>`, making the library compilable (and the tests pass) on the current (May 8th 2014) nightly.