Add a DB test for Media::UserCanEdit

This required a lot of db interaction changes and framework to support db changes.

* Moved install/update logic into re-useable code
* Created helper classes for db testing
* Support two DSNs (production and testing)
* DB testing involves:
 1: cleaning the database
 2: installing db structure
 3: installing mock data
 4: executing tests

To run, you will first have to:
* Run `vagrant provision` Add a testing DB to vagrant
* Update config to reflect code changes (see config.sample.php)

I did it this way because these test classes are more support classes for the tests than tests themselves.  Because they don't actually contain tests, it didn't make sense to put them in the tests directory to me.  I do however see your point.