Copy of old acts_as_tree taken from https://github.com/teaminsight/acts_as_tree.git (revision: e9aa919c7ec583426e26d2b26ee5a7c20bec76c1, branch: rails3)