Adding json view for datacube relations

Making jsonify module-level function so it can be reused