A recurisve function that takes an array of objects with a flat structure and transforms into a tiered, hierarchical structure that you can simply specify the nesting order, number of levels, and field names (e.g. sunburst chart, https://bl.ocks.org/mbostock/4348373, flare.json)