Move Attr::set_value and Attr::value out of the Attr impl

Fix #3270