DataFrame groupby.aggregate.to_dict() to JSON-compatible nested dict or list
#### Code Sample

```python
df_gb = df.groupby(['Factor1','Factor2'])['Values'].aggregate([np.mean, np.std])
df_sum = df_gb.groupby(['Factor1','Factor2']).aggregate(np.sum)
df_sum.to_dict()

{'mean': {(Factor1Name1, 'Factor2Name1'): 25.368616852061802,
  (Factor1Name1, 'Factor2Name2'): 17.085360464000004,
  (Factor1Name3, 'Factor2Name3'): 4.93063071},
 'std': {(Factor1Name1, 'Factor2Name1'): 24.14038328167582,
  (Factor1Name1, 'Factor2Name2'): 5.343434,
  (Factor1Name3, 'Factor2Name3'): 6.323232},
```
#### Problem description

This is not a problem, but a feature request. The `to_dict()` function outputs to a format that is difficult to use in terms of indexing or looping and is somewhat incompatible with JSON. I've written functions to output to nice nested dictionaries using both nested dicts and lists. This outputs JSON-style dicts, which is highly preferred for many tasks. My function has a simple switch to select the nesting style, dict or list. I would be happy to share this with the pandas community, but am unsure where to begin. Currently, the functions only support one or two factors for the groupby functions, but probably this could be extended to n-factors.

#### Expected Output

#### Output of ``df_sum.to_dict()``

<details>

{'Factor1': {Factor1Name1: {'Factor2': {
'Factor2Name1': {'mean': 25.368616852061802, 'std': 24.14038328167582},
'Factor2Name2': {'mean': 17.085360464000004, 'std': 10.954761709993713},
'Factor2Name3': {'mean': 4.93063071, 'std': 0.0}
...
}}}}

# or

{'Factor1s': [{'Factor1': Factor1Name1,
   'Factor2': [{'Values': {'mean': 25.368616852061802, 'std': 24.14038328167582},
     'Name': 'Factor2Name1'},
    {'Values': {'mean': 17.085360464000004, 'std': 10.954761709993713},
     'Name': 'Factor2Name2'}
...
]}]}

</details>
