Cleaned up DB connection

Instead of repeating my code to create the DB connection all over the
place, put this code in a single php file and then just include it
wherever needed.