Create database.php

All DB functionality.