awful.rules: add does_match and matching_rules functions

Fixes: https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1224

Signed-off-by: Daniel Hahler <git@thequod.de>