server: Fixed test query.  Add function to check database ready cvar.  This
still needs a lot of clean-up, but the basics are functional.