Rational design of advanced electrocatalysts for oxygen and hydrogen reactions in fuel cells and water electrolyzers