Remove empty top level when reading trees
Fix bug in print function
Simplify trees

Remove function tags, indices, and empty elements