Copy of old acts_as_tree taken from https://github.com/teaminsight/acts_as_tree.git