A Modular Framework for Battery Modeling in Electronic Designs