adds Rule.from_hash and Rule.from_json