Electrochromism For Linear And Nonlinear Nanoplasmonic And Dielectric Nanophotonic Devices