Dynamic control of radiative heat transfer with tunable materials for thermal management in both far and near fields