Update to work with the latest version of Rust, and add QuickCheck based testing.

Feel free to ignore the testing part, if you'd prefer to not rely on an external library for that (although I do believe the QC based tests have better code coverage).