Fix a terrible bug: add __init__ to TreeItem and don't use class variables where it shouldn't be used