Dynamic Tree Databases in Automated Planning