adding support for nested data, rule and messages. Not fully tested

Hi, just want to share some ideas to support my projects' needs. Beware: not fully tested.