Update JFormFieldSQL to use JDatabaseQuery

### Use JDatabaseQuery
This PR update the JFormFieldSQL input field to use JDatabaseQuery with separated query elements.
Into your form xml file you can set the query using this way:
```
<field name="example_group" 
type="sql" 
label="COM_EXAMPLE_GROUP" 
sql_select="e.*" 
sql_from="#__example AS e" 
sql_group="name" 
sql_order="e.id ASC" 
key_field="id"
value_field="name" 
onchange="this.form.submit();" />
```
This example will recreate this query:
```
SELECT e.* FROM #__example AS e GROUP BY name ORDER e.id ASC
```
### Filters
One posibility that offer use JDatabaseQuery instead the old way is to have a way to get "inline" filters. That mean that if you have multiple dropdowns as filter in your list view, its posible that you need to connect it togheter.

For example, we have 2 dropdowns that filter our list, one called "groups", another called "subgroups":

```
<field name="groups" 
type="sql" 
label="COM_EXAMPLE_GROUP" 
sql_select="e.*" 
sql_from="#__example_groups AS e" 
sql_group="name" 
sql_order="e.id ASC" 
key_field="id"
 value_field="name" 
onchange="this.form.submit();" />
```
And the second:
```
<field name="subgroups" 
type="sql" 
label="COM_EXAMPLE_GROUP" 
sql_select="e.*" 
sql_from="#__example_subgroups AS e" 
sql_group="name" 
sql_order="e.id ASC" 
sql_filter="groups"
key_field="id"
 value_field="name" 
onchange="this.form.submit();" />
```
Note that we added **sql_filter="groups"**, that search for groups changes and set the condition if its founded. So we can have a 'inline' filter on our lists. This will recreate:

```
SELECT e.* FROM #__example_subgroups AS e WHERE `groups` = 99 GROUP BY name ORDER e.id ASC
```
You are right about quoting, i'm fixing the PR right now. But if this code is fishy, current stable Joomla! sql.php field is has a big security issue because it is not filtering the query at all and it allow to put the entire query directly. Remember that only users with +rw privileges can exploit it.

https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/form/fields/sql.php#L161