I'd go with the D5100 over the D3100. Much better sensor with more dynamic range and better high ISO performance, articulated LCD with higher resolution, in-camera HDR, etc.
Cameta.com has the D5100 factory refurbished with the 18-55mm kit lens for $440. My experience with factory refurbs has always been positive. You get a virtually new camera (I've never received one that looked used), and it still comes with a one year warranty.