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)