DefaultTreeItem constructors refactored. Fixes #837