Hadronic contributions to the anomalous magnetic moment of the electron and the hyperfine splitting of muonium