The modified Crank-Nicolson scheme for the Allen-Cahn equation and mean curvature flow, and the numerical solutions for the stochastic Allen-Cahn equation