Refactor the tracing code, store the whole tree structure in a javascript array and...