Some initial work on TreeManager, incomplete.