The geometry of conservative systems of hydrodynamic type. The method of averaging for field-theoretical systems