Added validation of rule and transform to XML

Rule is now validated, different mistakes in condition or execute are
controled.
Added small UX help to show, where should be mistake. In future jQuery
tooltip should be used.
Result validated rule is converted to XML, which has the same format as
input (rules-demo.xml).