upgrade to Rust 0.11 and rewrite

The rewrite makes it more functional-styled. Prefer functions on plain data
instead of method syntax. I'll be honest, method syntax doesn't work great
in Rust, AFAICT