Added isValid().
Implemented validate().
Added hashCode() for MutableState.
Added support for asImmutable().