Added test cases. Added add/rm/modify rules.