Added version tag
Removed debugging, set fault code on fault
Removed debug statement. rule() is now query_rule.
grep is better than a foreach loop
Actually works correctly now