Management of Rules and Their Background Optimization in an Active Database