Standarized access from within

Added new functions to DB.php