I've got a D40, and it's really quite nice, and you won't find any more useful features in its successors (D40x, D60) besides more megapixels, which don't give you much, and actually reduce the maximum speed of the camera. $400 is a steal and you can use virtually any Nikon lens ever made. The only problem is that the camera doesn't have a motor for lenses which don't have auto-focus motors inside them, which is somewhat limiting. Remember, it isn't the equipment, so much as the photographer, that makes the shot decent.
Virtually any camera can take decent beam-shots if you are able to manually set your exposure. The longer the exposure, the more light it'll capture. Also remember to set the ISO settings to their lowest setting (and turn Auto-ISO off) prior to longer exposures, to reduce noise. This also assumes you have your camera on a tripod. As always, look at the result of your shot and try again if it doesn't look good.
For a camera, you can get a DSLR, but they don't do great macro shots right out of the box. You'll need some lenses and stuff (which I want to test with some from DX). I've found most of Canon's Powershot models do a decent job right out of the box. Some even do "SuperMacro" which is REALLY close-up.