While some of you probably already know this, I figured out how to keep fresh basil for a LONG time. Just keep the stems in water, like freshly cut flowers, until you are ready to use them. As you can see in the photo, my stems have grown roots and still have quite healthy leaves. The basil in the photo has been kept in a shot glass on my kitchen window sill for about 3 weeks, refilling the water as needed.
If you have a basil plant at home, pinch off the leaves (the newest growth), taking as much of the stem as you can before the next set of leaves. This not only helps the basil plant produce more leaves and grow fuller, but lets you keep a stem or two in the kitchen window for easy use.