Automatic badge awarding by defining rules

Rules can be created on a badge for autmatically awarding it.

Rules are simple now but it will be added more configuration options soon.