Moved DB Connect and Closing

Moved to header.php and footer.php, respectively.