A Mathematical Framework for the Modeling and Design of Redox-mediated Electrochemical Systems