Modeling of Phase-Change Memory: Nucleation, Growth, and Amorphization Dynamics During Set and Reset: Part I—Effective Media Approximation