Rework the json export of collections and file groups a bit
This is (at least in part) in preparation for doing similar with
cfs directories and files.
Add json for cfs directories and files.
Use JSON templates (instead of jbuilder directly) for these views.
I remember there was some problem where it wasn't working this way
before, but it's fine now, so we do it this, the recommened, way.
Simplify json building code a bit.
Use partials to remove some redundant code.
simplify with compressed syntax