Cleaned up use/syntax of database & query objects

Tracker item: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=30349

This pull request is a clean-up of core code.
Across the core different variable names and method names are used for the same thing. Like quote() and q() are ambiguous. But some code is using quote() and some is using q().

So this fix cleans up a lot of that, making sure the core uses the same ethod names and syntax for the database & query objects.

#### Changes
* Changed use of variable name ```$dbo``` to ```$db```
* Changed use of ```JFactory::getDBO()``` method to ```JFactory::getDbo()```
* Changed use of variable name ```$db->setQuery((string) $query)``` to ```$db->setQuery($query)```
* Changed use of variable name ```$sql``` to ```$query```
* ~~Changed use of ```quote()``` method to ```q()```~~
* ~~Changed use of ```quoteName()``` method to ```qn()```~~
* Changed use of ```q()``` method to ```quote()```
* Changed use of ```qn()``` method to ```quoteName()```
* Removed use of ```quoteName()``` method where not necessary (aliased tables)
* Changed ```$query->delete();$query->from(...);``` to ```$query->delete(...);```
* Changed ```leftJoin(...)``` to ```join('LEFT', ...)```
* Converted some string formatted sql statements to query objects
* Changed adjacent single line $query statements to single multiline statements:

```
$query = $db->getQuery(true);
$query->select(...);
$query->from(...);
$query->where(...);
```

becomes:
```
$query = $db->getQuery(true)
   ->select(...)
   ->from(...)
   ->where(...);
```

And some general syntax cleaning (like brackets on new lines and spaces around concatenators).

### Testing instructions
Seeing this touches many files, you will just have to test everything :)