Improving fuel economy through fuel management

Roads are not flat and level. With each downward slope of a road, a coasting car needs less fuel and most drivers do not let off the accelerator, or at least not enough.
My idea is simple: the car's computer (eec) reads two sensors, one at the front of the car and one at the rear.  The sensors tell the computer when the car is on a downhill slope trajectory.  When this occurs, the computer automatically reduces engine Rpm and fuel delivery, thus reducing fuel consumption.
It would actually be very similar to what cruise control does when it reduces throttle to maintain a set speed, but my idea would be focused on gas mileage and have greater engine control than cruise control has.  The Eec could even implement active cylinder shutdown (or auto stop/start) as well, reducing the number of cylinders burning fuel when the car is coasting downhill to further increase Mpg's.
For hybrid cars, perhaps a way can be implemented so that when coasting downhill occurs, this energy savings can be used to recharge the battery, or even saved for re-use when the car starts going uphill again to reduce later energy consumption.