You are given a list of object in javascript. Each object represents a node, and contain an "id" key and a "parent" key whose value is the id of the parent node. Show me the code for a function to convert this list into a Tree representation.