#97. Changed all call to the database to use a constant DATABASE_NAME defined in common.php