Added possibility to export the bucket to a "flattened" JSON file.