Refactored a method of MetaDataWithIncludes with code taken from the OdmToFilesConverter.java. Todo: use this machinery for the clinical data.