Adding multiple datasource support to database.php
Fixing DB lib issues.