Electrochemistry of formic acid and carbon dioxide on metal electrodes with applications to fuel cells and carbon dioxide conversion devices