Move DB connection to functions.php