Ensemble Based Quantum Memory And Adiabatic Phase Gates In Electron Spins