Trait based inheritance

This is largely based upon #9 and #91, but fleshed out to make an actual inheritance proposal.
Cast is almost the wrong name for the trait, because casting in both Rust and C is a conversion preserving the value, not something like a blind transmute.