Collected fields in sub groups

Return collected fields in sub groups when both grouping with `group_by` and with `period`.

This pull request refactors the code that merges grouped periodic query results into the nested data structure that's returned by backdrop. The code has been simplified and moved out into it's own module (`backdrop.core.mested_merge`).

All parts of `nested_merge` are recursive now, so more levels of grouping should be easy to add.