Largely fix these tests.  Stop using a mock, we control the database
configuration and we're calling compile() which is fast enough so it's
useful to test the full API here and not reach into testing the
database innards.

The one exception is testing the prefix replacement, which is a new
API that exists only in Gallery_Database and classes that inherit from
it.  But we expect that we'll always be using a Gallery_Database so
it's fair to test that API here as if it were part of the regular
Database API.