Replace ~ with Box

This upgrades the code to the latest Rust version.
Merge pull request #39 from hannobraun/master

Replace ~ with Box