Refactor rules engine return value

Instead of returning all appliacble rules in an array, now it returns
an array of executed applicable rules and another of non-executed
applicable rules.