Database connection refactoring

 - Hide E_WARNING & E_NOTICE from <production>
 - Introduce template for database error