Add FromPrimitive to a few enums, to allow casting from primitive types.
Merge pull request #235 from nstoddard/master

Add FromPrimitive to a few enums, to allow casting from primitive types.