Move isLeaf method from TreeWidgetJSON object to TreeWidgetItemJSON object.