Update code samples

I updated the files in the `code` directory to match the code in the `book` directory. All code samples under the `code` directory now compile with Rust 0.13 with a few warnings on chapters 8 & 10.