Indexed Scripts/Templates: Add support for storing/deleting/getting scripts/template from an index.

This change allow elasticsearch users to store scripts and templates in an index for use at search time.
Scripts/Templates are stored in the .scripts index. The type of the events is set to the script language.
Templates use the mustache language so their type is be "mustache".
Adds the concept of a script type to calls to the ScriptService types are INDEXED,INLINE,FILE.
If a script type of INDEXED is supplied the script will be attempted to be loaded from the indexed, FILE will
look in the file cache and INLINE will treat the supplied script argument as the literal script.
REST endpoints are provided to do CRUD operations as is a java client library.
All query dsl points have been upgraded to allow passing in of explicit script ids and script file names.
Backwards compatible behavior has been preserved so this shouldn't break any existing querys that expect to
pass in a filename as the script/template name. The ScriptService will check the disk cache before parsing the
script.

Closes #5921 #5637 #5484
Docs: Update query-string-syntax.asciidoc

Closes #6853
[TEST] fix compile problems on Java 8
[TEST] Fix test issues with branches still using mvel as default scripting language
[TEST] Fix test relying on order of json for matching
Test: add diagnostics to get some details next time this test fails
Added more utility methods to Settings

- names() to return the direct settings names
- getAsSettings(String) to return the settings mapped to the given name (like getByPrefix(...) except no need to provide a tailing '.')
[TEST] close IW before listing directory content
Phrase Suggester: Add collate option to PhraseSuggester

The newly added collate option will let the user provide a template query/filter which will be executed for every phrase suggestions generated to ensure that the suggestion matches at least one document for the filter/query.
The user can also add routing preference `preference` to route the collate query/filter and additional `params` to inject into the collate template.

Closes #3482
[TEST] fix PhraseInIndex test bug for shard failure
[TEST] fix random preference string test to accomodate for the new more strict preference type
Stats: Expose IndexWriter and VersionMap RAM usage to ShardStats and _cat endpoint

This commit adds the RAM usage of IndexWriter and VersionMap

Closes #6483
[TEST] fix random preference string tests to accomodate for the new more strict preference type
[TEST] use higher timeout to wait for balanced cluster

CorruptFileTest sometimes hits conditions where lots of rebalancing
happens. In such a case the default timeout is just not enough - this
timeout just makes sure that the cluster has enough time to balance
itself.
Add version check before reading script type in UpdateRequest
Indexed Scripts/Templates: cleanup

This commit cleans up some code around the indexed script/templates feature.
Remove dead code in ScriptService.
Remove setXScript methods for UpdateRequestBuilder and use setScript(script,type) instead
Added missing version based serialization
[TEST] Fix test to use keyword analyzer since it relies on exact terms without processing
[SEARCH] Wrap filter only once in ApplyAcceptedDocsFilter

We potentially wrap the given filter multiple times when iterating the
subreaders. We only need to do this once.

Closes #6873
Core: don't close/reopen IndexWriter when changing RAM buffer size

Today we close/reopen IW when we change the RAM buffer but that's
costly because it means the next NRT reader is a full reopen.  The RAM
buffer size setting is a live one in IndexWriter, even if there are no
buffered docs in RAM when you call it.

Separately it would be nice if Lucene let you manage a "reader pool"
that could outlive individual IW instances ...

Closes #6856