lib: Add a db.php file

Issue #69.