Move shared parts of get_db_spec() into drush_sql_get_class(). Fixes #536.
Refactor valid_credentials() check during validation of database bootstrap phase.