CHIL and PHIL Simulation Advancing Smart Grid and Microgrid Research and Testing