Fixing up the tests to support namespaces.
Transaction and PDO updates.

Began using a flag to keep track of transaction states. Decent solution to
what was previously failing the test, though time will tell if it's an
appropriate solution. Otherwise, turned database into a PDO extension
instead of having a PDO object inside of it.