Changed tree directive:
- to support json_data
- added events handler
- possibility of adding plugins