A principled analysis of Behavior Trees and their generalisations