add Registration#to_h
add Registration.from_h
Registration#to_h: add client support