Hierarchical, rule-based, data-driven validator for complex data structures with support for nested scopes and recursion