Battery repurposing of plug-in electric vehicles: a framework for the integration of renewable energy and electrified transportation