Adding generic db_connection() method - plus pep8 fixes.