Add tests for database functions

And fix the bugs that popped up.
Test more db user functions

And fix bug that came up
Add test for grant_all_privileges to database
Test create_db_if_not_exists()