moved query code from class.wca.php into separate class wcadb.php