Hydrogen vs. Battery Electric Cars

I've been rooting for batteries instead of fuel cells due to the flexibility of being able to build charging stations anywhere that can connect to the grid or even just a solar panel in a random location, but if we had the technology to have hydrogen be produced right at the refueling stations, or better, right in the cars themselves, batteries would die a pretty quick death.  This is the tech that I hope someone is working on, maybe through hydrolysis or some other means.