Structure and electrochemistry of polymer electrolytes