refactoring rules en monitoring, added a querymanager, rules can read rulescripts now.