Change categories when editing a rule

#165 
The last thing I have a question about is here. besides rule_id, new_parent_id can also be out of bounds.