Add the ability to return non-nested responses

This functionality means we no longer need to use JavaScript on the client
side to flatten the data.

The code has been written so it should be relatively straightforward to strip
out the grouped/nested code in the future when Backdrop changes to only return
flattened responses.
![](https://i.imgflip.com/bak10.jpg)