core: add {Imm,M}utablePrimitiveSlice trait

Lets eligible slices be converted to a slice of bytes. Abstracts out some
sensible unsafe behavior from `rust-image`.
This is unsafe, because `Primitive` is just a trait, and can be implemented for new types (e.g. new enums that you create). Also note that `Primitive` has been deprecated.