Cleaned up modify tree factory, railroad directive, and main controller

Also resets the starting idNum to 0 each time a new tree is created