Inverter/charger with pure sine wave output