In one of my vehicles (a Honda Accord), I experienced the problem you're having...the engin would race to about 1700 rpm then drop to idle, then race again to 1700, back to idle. It would continue this pattern until I shut it off, spending a second or so at each rpm. It eventually threw a DTC (diagnostic trouble code) which when read with my scan tool led me straight to the Idle Air Control Valve. Are you getting a DTC or a pending DTC (the latter is an indication of a problem that hasn't set the check engine light on, yet)? A little money ($75 to $100 (don't recall exactly) for a new IACV) and elbow grease (about an hour of work) later, the problem was fixed.
I'm surprised that yours wants to bog down when it idles. When you replace or clean your IACV, you might want to clean your throttle body at the same time...often problems with poor idle quality and some trouble codes are attributable to a coked-up throttle body. I worked on an Explorer for an acqaintance once than had a MAF sensor code and wouldn't idle (though it would run if you kept it revved up). After cleaning the throttle body and allowing all of the throttle body cleaner to burn out of the intake manifold, the Explorer idled like a champ and the code cleared itself.