move _unicodify_value out of Headers class

Extract `_unicodify_value` so other classes can use it.