fixed better db-support and bug fixes for database.

Conflicts:
	phpunit/bootstrap.php