Move `attributes_before_type_cast` to `AttributeSet`

also, should this method return not a hash but another `AttributeSet` object?