Unit test support

No tests are actually included yet, so attempting to run phpunit will
result in a warning.
Database trait now contains an accessor

Attempting to access the db object before it has been set results in an
exception being thrown.
Test for DatabaseTrait