Fleshed out to_dict and from_obj methods