Heterotic string compactifications with fluxes