A Microgrid Energy Management System Supported by a Hysteresis Vehicle to Grid Controller