Take a list of items related by a parent property and make a tree