Changed references from functions to their respective classes, updated db.php.