Accurate and Efficient Computation of Layered Medium Doubly Periodic Green's Function in Matrix-Friendly Formulation