function_score: add optional weight parameter per function

Weights can be defined per function like this:

```
"function_score": {
    "functions": [
        {
            "filter": {},
            "FUNCTION": {},
            "weight": number
        }
        ...
```
If `weight` is given without `FUNCTION` then `weight` behaves like `boost_factor`.
This commit deprecates `boost_factor`.

The following is valid:

```
POST testidx/_search
{
  "query": {
    "function_score": {
      "weight": 2
    }
  }
}
POST testidx/_search
{
  "query": {
    "function_score": {
      "functions": [
        {
          "weight": 2
        },
        ...
      ]
    }
  }
}
POST testidx/_search
{
  "query": {
    "function_score": {
      "functions": [
        {
          "FUNCTION": {},
          "weight": 2
        },
        ...
      ]
    }
  }
}
POST testidx/_search
{
  "query": {
    "function_score": {
      "functions": [
        {
          "filter": {},
          "weight": 2
        },
        ...
      ]
    }
  }
}
POST testidx/_search
{
  "query": {
    "function_score": {
      "functions": [
        {
          "filter": {},
          "FUNCTION": {},
          "weight": 2
        },
        ...
      ]
    }
  }
}
```

The following is not valid:

```
POST testidx/_search
{
  "query": {
    "function_score": {
      "weight": 2,
      "FUNCTION(including boost_factor)": 2
    }
  }
}

POST testidx/_search
{
  "query": {
    "function_score": {
      "functions": [
        {
          "weight": 2,
          "boost_factor": 2
        }
      ]
    }
  }
}
````

closes #6955
The explanation contains the wrapped function already, example below. Is this what you meant?
In the example the string describing the decay function misses a `[`, will fix in a different commit.
```
{
  "explain": true,
  "query": {
    "function_score": {
      "query": {
        "match": {
          "text": "foo"
        }
      },
      "functions": [
        {
          "linear": {
            "number": {
              "origin": "1",
              "scale": "5"
            }
          },
          "weight": 10
        }
      ]
    }
  }
}
```
result:
```
            "_explanation": {
               "value": 1.726047,
               "description": "function score, product of:",
               "details": [
                  {
                     "value": 0.19178301,
                     "description": "weight(text:foo in 0) [PerFieldSimilarity], result of:",
                     "details": [
                        {
                           "value": 0.19178301,
                           "description": "fieldWeight in 0, product of:",
                           "details": [
                              {
                                 "value": 1,
                                 "description": "tf(freq=1.0), with freq of:",
                                 "details": [
                                    {
                                       "value": 1,
                                       "description": "termFreq=1.0"
                                    }
                                 ]
                              },
                              {
                                 "value": 0.30685282,
                                 "description": "idf(docFreq=1, maxDocs=1)"
                              },
                              {
                                 "value": 0.625,
                                 "description": "fieldNorm(doc=0)"
                              }
                           ]
                        }
                     ]
                  },
                  {
                     "value": 9,
                     "description": "Math.min of",
                     "details": [
                        {
                           "value": 9,
                           "description": "product of:",
                           "details": [
                              {
                                 "value": 0.9,
                                 "description": "Function for field number:",
                                 "details": [
                                    {
                                       "value": 0.9,
                                       "description": "max(0.0, ((10.0 - MINMath.max(Math.abs(2.0(=doc value) - 1.0(=origin))) - 0.0(=offset), 0)])/10.0)"
                                    }
                                 ]
                              },
                              {
                                 "value": 10,
                                 "description": "weight"
                              }
                           ]
                        },
                        {
                           "value": 3.4028235e+38,
                           "description": "maxBoost"
                        }
                     ]
                  },
                  {
                     "value": 1,
                     "description": "queryBoost"
                  }
               ]
            }
```