Modeling of Nucleation and Dynamic Rupture on Heterogeneous Frictional Interfaces with Applications to Foreshocks