Lua script to convert tree to 'taxonomy file'