use promise pattern
implements function to build tree from file lists