moved database.php inside classes. Implemented a test for pdo connection to db.