Polymer-based electrochromic devices