Internal: deduplicate useful headers that get copied from REST to transport requests

The useful headers are now stored into a `Set` instead of an array so we can easily deduplicate them. A set is also returned instead of an array by the `usefulHeaders` static getter.

Relates to #6513

Closes #7590
Refactored TransportMessage context

Removed CHM in favour of an OpenHashMap and synchronized accessor/mutator methods. Also, the context is now lazily inititialied (just like we do with the headers)
Indexed scripts: make sure headers are handed over to internal requests and streamline versioning support

The get, put and delete indexed script apis map to get, index and delete api and internally create those corresponding requests. We need to make sure that the original headers are handed over to the new request by passing the original request in the constructor when creating the new one.

Also streamlined the support for version and version_type in the REST layer since the parameters were not consistently parsed and set to the internal java API requests.

Modified the REST delete template and delete script actions to make use of a client instead of using the `ScriptService` directly.

Closes #7569
Docs: Fixed typo in windows-as-a-service
Internal: Upgrade Guava to 18.0.

17.0 and earlier versions were affected by the following bug
https://code.google.com/p/guava-libraries/issues/detail?id=1761
which caused caches that are configured with weights that are greater than
32GB to actually be unbounded. This is now fixed.

Relates to #6268
Close #7593
Term Vectors: Support for artificial documents

This adds the ability to the Term Vector API to generate term vectors for
artifical documents, that is for documents not present in the index. Following
a similar syntax to the Percolator API, a new 'doc' parameter is used, instead
of '_id', that specifies the document of interest. The parameters '_index' and
'_type' determine the mapping and therefore analyzers to apply to each value
field.

Closes #7530
TransportClient: Mark transport client as such when instantiating

This allows plugins to load/inject specific classes, when the client started
is a transport client (compared to being a node client).

Closes #7552
Introduced a transient context to the rest request

Similar to the one in `TransportMessage`. Added the `ContextHolder` base class where both `TransportMessage` and `RestRequest` derive from

Now next to the known headers, the context is always copied over from the rest request to the transport request (when the injected client is used)
[Lucene] Upgrade to Lucene 4.10

Closes #7584
[TEST] Allow SingleNodeTest to reset the node if really needed after test
[STORE] Simplify reading / writing from and to BlobContainer

BlobContainer used to provide async APIs which are not used
internally. The implementation of these APIs are also not async
by nature and neither is any of the pluggable BlobContainers. This
commit simplifies the API to a simple input / output stream and
reduces the hierarchy of BlobContainer dramatically.
NOTE: This is a breaking change!

Closes #7551
RestAPI: Add explicit error when PUT mapping API is given an empty request body.

closes #7536
closes #7618
Internal: Change LZFCompressedStreamOutput to use buffer recycler when allocating encoder

closes #7613
Extended ActionFilter to also enable filtering the response side

Enables filtering the actions on both sides - request and response. Also added a base class for filter implementations (cleans up filters that only need to filter one side)

Also refactored the filter & filter chain methods to more intuitive names
Docs: Update cardinality-aggregation.asciidoc

Closes #7516
[TEST] Close input stream in test to not upset windows
RestAPI: Change validation exceptions to respond with 400 status instead of 500.

Validation errors are clearly in the realm of client errors (a program
with the request).  Thus they should return a 4xx response code.

closes #7619
Docs: Wrong class name

Was QFilterBuilders, should be FilterBuilders.

Closes #7611
Docs: Added explanation of how to do multi-field terms agg

Closes #5100
Docs: Update span-not-query.asciidoc

The example given does not clearly explain what the query does.

Closes #7049