Type support

Added support for coercing attributes to types, custom model names, and basic attribute protection.

Also, fixed the before save/update/create callbacks.