Have you checked for cracked exhaust manifold, Intake / Exh leaks, Clogged and restricted Injectors, Dirty or bad TB or TPS? Also, Look at the spark plugs, they will tell a lot about any fuel or ignition problems.
Clogged cat and muffler generally bog down performance a little, but do not directly cause poor idle.
A better cat and Dynomax, Magnaflow, or even Flowmaster + intake do wake up Jeep 4.0L pretty nice, and can be done pretty cheap; but won't fix rough idle or running issues.