I will add an interesting flavor of physics to spice up Martin's excellent chemistry answer and which is in line with your original reasoning on how to trace energy content.
When chemical reactions take place and bonds form, break, and reshape, the atom nuclei don't change in any way. What happens is that the electrons jump between atoms or groups of atoms and change orbits. The different orbits are bound by different energies and you can start with a configuration of atoms and electrons and end up with another configuration but the total energy stays the same. This is really all there is to it, and thinking about that will give you a lot of intuition in particular with "energetic" chemistry.
The "trick" with using molecules to store energy is that, like you wrote yourself, apart from the energy density, sometimes you want to control the movement of the electrons in a very tight way and sometimes you just want as much kinetic (heat) energy quickly.
For example in the biological mitochondria, the electrons of the molecular by-products of glucose metabolism are delicately bounced around until they end up orbiting CO2 molecules, with their initial potential energy being deposited as high-energy bonds on ATP molecules (used in the body as energy storage) and as little energy as possible lost as kinetic energy (heat). This process is actually called an electron transport chain and is quite complicated and, should you look at the actual proteins and molecules involved, surprisingly mechanical in some ways :)
On the other hand, if you burn glucose in a fire, you also end up with exactly the same CO2 end product, but the electrons' paths there are chaotic and create a lot of kinetic energy (heat) and no ATP or other useful intermediary. This would be quite useless in a human body, but good for creating engines that depend on heat (or the resulting expansion of gas volume).
Regardless of the form of electron transport in the above examples (or if you insert gasoline in a similar reasoning chain), the fascinating fact is that the actual energy chain starts with electrons in "high" orbits around some atomic nuclei due to photons from the sun for example, and can be traced to end up at a "tighter" orbit around some carbon and oxygen atoms a billion years later!
Caveat: obviously electrons don't carry individual names, they are quantum mechanically identical and are exchanged and transported as such. The "orbits" are not classical satellite orbits around nuclei either. But the basic principle is still sound.