Rewrite of original TreeManager to Dancer framework