Original JSON data (flat table):
[
{\"id\":\"1\",\"first_name\":\"Jason\",\"last_name\":\"Martin\",\"start_date\":\"1996-07-25\",\"end_date\":\"2006-07-25\",
Building on the example provided by @nrabinowitz, here's the nest function with the originally proposed API of passing the collection and an array of property names as args, using d3.nest under the hood:
function nest(data, keys) {
var nest = d3.nest();
keys.forEach(function(k) {
nest.key(function(d) {
return d[k];
})
});
return nest.entries(data);
}