Density-Functional Theory Applied To Problems In Catalysis And Electrochemistry