Reversible battery charger for electric vehicles