Exactly Patrick. Performance on a computer is characterized by (largely) 3 components. CPU, RAM and storage. If storage read/writes are slow, having a REALLY fast CPU or tons of RAM means nothing since you can't process lots of stuff and store temporary stuff for later processing. If your CPU is really slow, then it doesn't matter how much RAM or how fast you storage is since processing power is the bottleneck. If you have very limited RAM, you'll end up spending a lot of CPU cycles and storage write time making room for the applications and overall performance suffers.
So, upgrading from HDD to SSD speeds up the storage part. If your CPU was already fairly fast, then upgrading RAM to a larger number will yield a benefit.
A 2007 circa CPU is no match to anything that's come out in the past couple of years. That iMac is at best a Core2Duo CPU where's even the slowest current gen i3 (2 cores) will easily outperform it.